Search in sources :

Example 6 with BannerEventListener

use of org.prebid.mobile.rendering.bidding.listeners.BannerEventListener in project prebid-mobile-android by prebid.

the class BannerViewTest method onAdServerWin_AdRequestStatusIsFinishedDisplayAdViewAndNotifyAdReceivedListener.

@Test
public void onAdServerWin_AdRequestStatusIsFinishedDisplayAdViewAndNotifyAdReceivedListener() {
    changePrimaryAdServerRequestStatus(true);
    final View mockView = mock(View.class);
    final BannerEventListener bannerEventListener = getBannerEventListener();
    bannerEventListener.onAdServerWin(mockView);
    assertFalse(mBannerView.isPrimaryAdServerRequestInProgress());
    verify(mMockBannerListener, times(1)).onAdLoaded(mBannerView);
// verify(spyBannerView).displayAdServerView(mockView);
}
Also used : BannerEventListener(org.prebid.mobile.rendering.bidding.listeners.BannerEventListener) View(android.view.View) DisplayView(org.prebid.mobile.rendering.bidding.display.DisplayView) Test(org.junit.Test)

Example 7 with BannerEventListener

use of org.prebid.mobile.rendering.bidding.listeners.BannerEventListener in project prebid-mobile-android by prebid.

the class BannerViewTest method onPrebidSdkWin_AdRequestStatusIsFinishedDisplayAdView.

@Test
public void onPrebidSdkWin_AdRequestStatusIsFinishedDisplayAdView() {
    changePrimaryAdServerRequestStatus(true);
    final BannerEventListener bannerEventListener = getBannerEventListener();
    final BidResponse mockBidResponse = mock(BidResponse.class);
    final Bid mockBid = mock(Bid.class);
    when(mockBidResponse.getWinningBid()).thenReturn(mockBid);
    when(mockBidResponse.getWinningBidWidthHeightPairDips(any())).thenReturn(Pair.create(0, 0));
    mBannerView.setBidResponse(mockBidResponse);
    bannerEventListener.onPrebidSdkWin();
    assertFalse(mBannerView.isPrimaryAdServerRequestInProgress());
}
Also used : BannerEventListener(org.prebid.mobile.rendering.bidding.listeners.BannerEventListener) BidResponse(org.prebid.mobile.rendering.bidding.data.bid.BidResponse) Bid(org.prebid.mobile.rendering.bidding.data.bid.Bid) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)7 BannerEventListener (org.prebid.mobile.rendering.bidding.listeners.BannerEventListener)7 AdException (org.prebid.mobile.rendering.errors.AdException)3 Bid (org.prebid.mobile.rendering.bidding.data.bid.Bid)2 BidResponse (org.prebid.mobile.rendering.bidding.data.bid.BidResponse)2 View (android.view.View)1 DisplayView (org.prebid.mobile.rendering.bidding.display.DisplayView)1