use of org.prebid.mobile.rendering.bidding.listeners.BidRequesterListener in project prebid-mobile-android by prebid.
the class RewardedAdUnitTest method onFetchComplete_ChangeInterstitialStateToLoadingAndRequestAdWithBid.
// region ======================= BidRequestListener tests
@Test
public void onFetchComplete_ChangeInterstitialStateToLoadingAndRequestAdWithBid() {
final BidResponse mockBidResponse = mock(BidResponse.class);
final Bid mockBid = mock(Bid.class);
when(mockBidResponse.getWinningBid()).thenReturn(mockBid);
BidRequesterListener listener = getBidRequesterListener();
listener.onFetchCompleted(mockBidResponse);
verify(mMockRewardedEventHandler, times(1)).requestAdWithBid(eq(mockBid));
assertEquals(LOADING, mRewardedAdUnit.getAdUnitState());
}
use of org.prebid.mobile.rendering.bidding.listeners.BidRequesterListener in project prebid-mobile-android by prebid.
the class InterstitialAdUnitTest method onError_RequestAdWitNullBid.
@Test
public void onError_RequestAdWitNullBid() {
BidRequesterListener listener = getBidRequesterListener();
listener.onError(any());
verify(mMockInterstitialEventHandler, times(1)).requestAdWithBid(eq(null));
}
use of org.prebid.mobile.rendering.bidding.listeners.BidRequesterListener in project prebid-mobile-android by prebid.
the class InterstitialAdUnitTest method onFetchComplete_ChangeInterstitialStateToLoadingAndRequestAdWithBid.
// region ======================= BidRequestListener tests
@Test
public void onFetchComplete_ChangeInterstitialStateToLoadingAndRequestAdWithBid() {
final BidResponse mockBidResponse = mock(BidResponse.class);
final Bid mockBid = mock(Bid.class);
when(mockBidResponse.getWinningBid()).thenReturn(mockBid);
BidRequesterListener listener = getBidRequesterListener();
listener.onFetchCompleted(mockBidResponse);
verify(mMockInterstitialEventHandler, times(1)).requestAdWithBid(eq(mockBid));
assertEquals(LOADING, mInterstitialAdUnit.getAdUnitState());
}
use of org.prebid.mobile.rendering.bidding.listeners.BidRequesterListener in project prebid-mobile-android by prebid.
the class BannerViewTest method onError_NullifyWinnerBidAndRequestAdWitNullBid.
@Test
public void onError_NullifyWinnerBidAndRequestAdWitNullBid() {
final BidResponse mockBidResponse = mock(BidResponse.class);
final Bid mockBid = mock(Bid.class);
when(mockBidResponse.getWinningBid()).thenReturn(mockBid);
mBannerView.setBidResponse(mockBidResponse);
BidRequesterListener listener = getBidRequesterListener();
listener.onError(any());
assertNull(mBannerView.getWinnerBid());
assertNull(mBannerView.getBidResponse());
verify(mMockEventHandler, times(1)).requestAdWithBid(eq(null));
}
use of org.prebid.mobile.rendering.bidding.listeners.BidRequesterListener in project prebid-mobile-android by prebid.
the class BannerViewTest method onFetchComplete_AssignWinningBidMarkPrimaryServerRequestInProgressRequestAdWithBid.
// region ======================= BidRequestListener tests
@Test
public void onFetchComplete_AssignWinningBidMarkPrimaryServerRequestInProgressRequestAdWithBid() {
final BidResponse mockBidResponse = mock(BidResponse.class);
final Bid mockBid = mock(Bid.class);
when(mockBidResponse.getWinningBid()).thenReturn(mockBid);
BidRequesterListener listener = getBidRequesterListener();
listener.onFetchCompleted(mockBidResponse);
Bid winningBid = mBannerView.getWinnerBid();
BidResponse actualResponse = mBannerView.getBidResponse();
assertEquals(winningBid, mockBid);
assertEquals(mockBidResponse, actualResponse);
verify(mMockEventHandler, times(1)).requestAdWithBid(eq(mockBid));
assertTrue(mBannerView.isPrimaryAdServerRequestInProgress());
}
Aggregations