use of org.prebid.mobile.rendering.bidding.listeners.BannerEventListener in project prebid-mobile-android by prebid.
the class BannerViewTest method onFailedAndWithWinnerBid_AdRequestStatusIsFinishedNotifyPrebidSdkWin.
@Test
public void onFailedAndWithWinnerBid_AdRequestStatusIsFinishedNotifyPrebidSdkWin() {
changePrimaryAdServerRequestStatus(true);
final BidResponse mockBidResponse = mock(BidResponse.class);
final Bid mockBid = mock(Bid.class);
final BannerEventListener spyEventListener = spy(getBannerEventListener());
when(mockBidResponse.getWinningBid()).thenReturn(mockBid);
when(mockBidResponse.getWinningBidWidthHeightPairDips(any())).thenReturn(Pair.create(0, 0));
mBannerView.setBidResponse(mockBidResponse);
spyEventListener.onAdFailed(new AdException(AdException.INTERNAL_ERROR, "Test"));
assertFalse(mBannerView.isPrimaryAdServerRequestInProgress());
verify(spyEventListener, times(1)).onPrebidSdkWin();
}
use of org.prebid.mobile.rendering.bidding.listeners.BannerEventListener in project prebid-mobile-android by prebid.
the class BannerViewTest method onPrebidSdkWinAndWinnerBidIsNull_AdRequestStatusIsFinishedNotifyErrorListener.
// endregion ======================= BidRequestListener tests
// region ================= BannerEventListener tests
@Test
public void onPrebidSdkWinAndWinnerBidIsNull_AdRequestStatusIsFinishedNotifyErrorListener() {
changePrimaryAdServerRequestStatus(true);
final BannerEventListener bannerEventListener = getBannerEventListener();
mBannerView.setBidResponse(null);
bannerEventListener.onPrebidSdkWin();
verify(mMockBannerListener, times(1)).onAdFailed(eq(mBannerView), any(AdException.class));
assertFalse(mBannerView.isPrimaryAdServerRequestInProgress());
}
use of org.prebid.mobile.rendering.bidding.listeners.BannerEventListener in project prebid-mobile-android by prebid.
the class BannerViewTest method onAdOpened_NotifyAdClickedListener.
@Test
public void onAdOpened_NotifyAdClickedListener() {
final BannerEventListener bannerEventListener = getBannerEventListener();
bannerEventListener.onAdClicked();
verify(mMockBannerListener, times(1)).onAdClicked(mBannerView);
}
use of org.prebid.mobile.rendering.bidding.listeners.BannerEventListener in project prebid-mobile-android by prebid.
the class BannerViewTest method onAdClosed_NotifyAdClosedListener.
@Test
public void onAdClosed_NotifyAdClosedListener() {
final BannerEventListener bannerEventListener = getBannerEventListener();
bannerEventListener.onAdClosed();
verify(mMockBannerListener, times(1)).onAdClosed(mBannerView);
}
use of org.prebid.mobile.rendering.bidding.listeners.BannerEventListener in project prebid-mobile-android by prebid.
the class BannerViewTest method onFailedAndNoWinnerBid_AdRequestStatusIsFinishedNotifyErrorListener.
@Test
public void onFailedAndNoWinnerBid_AdRequestStatusIsFinishedNotifyErrorListener() {
changePrimaryAdServerRequestStatus(true);
mBannerView.setBidResponse(null);
final AdException exception = new AdException(AdException.INTERNAL_ERROR, "Test");
final BannerEventListener bannerEventListener = getBannerEventListener();
bannerEventListener.onAdFailed(exception);
verify(mMockBannerListener, times(1)).onAdFailed(mBannerView, exception);
}
Aggregations