use of org.prebid.mobile.rendering.bidding.listeners.RewardedVideoEventListener in project prebid-mobile-android by prebid.
the class RewardedAdUnitTest method onFailedAndWithWinnerBid_ExecuteInterstitialControllerLoadAd.
@Test
public void onFailedAndWithWinnerBid_ExecuteInterstitialControllerLoadAd() throws IllegalAccessException {
final BidResponse mockBidResponse = mock(BidResponse.class);
final InterstitialController mockInterstitialController = mock(InterstitialController.class);
final Bid mockBid = mock(Bid.class);
final RewardedVideoEventListener spyEventListener = spy(getEventListener());
when(mockBidResponse.getWinningBid()).thenReturn(mockBid);
WhiteBox.setInternalState(mRewardedAdUnit, "mBidResponse", mockBidResponse);
WhiteBox.setInternalState(mRewardedAdUnit, "mInterstitialController", mockInterstitialController);
spyEventListener.onAdFailed(new AdException(AdException.INTERNAL_ERROR, "Test"));
verify(spyEventListener, times(1)).onPrebidSdkWin();
verify(mockInterstitialController, times(1)).loadAd(any(), any());
}
use of org.prebid.mobile.rendering.bidding.listeners.RewardedVideoEventListener in project prebid-mobile-android by prebid.
the class RewardedAdUnitTest method onAdOpened_NotifyClickListener.
@Test
public void onAdOpened_NotifyClickListener() {
final RewardedVideoEventListener eventListener = getEventListener();
eventListener.onAdClicked();
verify(mMockRewardedAdUnitListener, times(1)).onAdClicked(mRewardedAdUnit);
}
use of org.prebid.mobile.rendering.bidding.listeners.RewardedVideoEventListener in project prebid-mobile-android by prebid.
the class RewardedAdUnitTest method onAdClosed_NotifyAdClosedListener.
@Test
public void onAdClosed_NotifyAdClosedListener() {
final RewardedVideoEventListener eventListener = getEventListener();
eventListener.onAdClosed();
verify(mMockRewardedAdUnitListener, times(1)).onAdClosed(mRewardedAdUnit);
}
use of org.prebid.mobile.rendering.bidding.listeners.RewardedVideoEventListener in project prebid-mobile-android by prebid.
the class RewardedAdUnitTest method onFailedAndNoWinnerBid_AdStatusReadyForLoadNotifyErrorListener.
@Test
public void onFailedAndNoWinnerBid_AdStatusReadyForLoadNotifyErrorListener() {
final AdException exception = new AdException(AdException.INTERNAL_ERROR, "Test");
final RewardedVideoEventListener eventListener = getEventListener();
eventListener.onAdFailed(exception);
verify(mMockRewardedAdUnitListener, times(1)).onAdFailed(mRewardedAdUnit, exception);
assertEquals(READY_FOR_LOAD, mRewardedAdUnit.getAdUnitState());
}
use of org.prebid.mobile.rendering.bidding.listeners.RewardedVideoEventListener in project prebid-mobile-android by prebid.
the class RewardedAdUnitTest method onAdServerWin_AdStatusReadyToDisplayGAMNotifyAdLoaded.
@Test
public void onAdServerWin_AdStatusReadyToDisplayGAMNotifyAdLoaded() {
final RewardedVideoEventListener eventListener = getEventListener();
eventListener.onAdServerWin(any());
assertEquals(BaseInterstitialAdUnit.InterstitialAdUnitState.READY_TO_DISPLAY_GAM, mRewardedAdUnit.getAdUnitState());
verify(mMockRewardedAdUnitListener, times(1)).onAdLoaded(mRewardedAdUnit);
}
Aggregations