Search in sources :

Example 1 with Prebid

use of org.prebid.mobile.rendering.bidding.data.bid.Prebid in project prebid-mobile-android by prebid.

the class GamBannerEventHandlerTest method requestAdWithDifferentBids_VerifyAdStatus.

@Test
public void requestAdWithDifferentBids_VerifyAdStatus() {
    final Bid mockBid = mock(Bid.class);
    final Prebid mockPrebid = mock(Prebid.class);
    when(mockPrebid.getTargeting()).thenReturn(new HashMap<>());
    when(mockBid.getPrebid()).thenReturn(mockPrebid);
    when(mockBid.getPrice()).thenReturn(0.2);
    mBannerEventHandler.requestAdWithBid(mockBid);
    assertTrue(getExpectingAppEventStatus());
    when(mockBid.getPrice()).thenReturn(0.0);
    mBannerEventHandler.requestAdWithBid(mockBid);
    assertFalse(getExpectingAppEventStatus());
    mBannerEventHandler.requestAdWithBid(null);
    assertFalse(getExpectingAppEventStatus());
}
Also used : Prebid(org.prebid.mobile.rendering.bidding.data.bid.Prebid) Bid(org.prebid.mobile.rendering.bidding.data.bid.Bid) Test(org.junit.Test)

Example 2 with Prebid

use of org.prebid.mobile.rendering.bidding.data.bid.Prebid in project prebid-mobile-android by prebid.

the class GamInterstitialEventHandlerTest method requestAdWithDifferentBids_VerifyAdStatus.

@Test
public void requestAdWithDifferentBids_VerifyAdStatus() {
    final Bid mockBid = mock(Bid.class);
    final Prebid mockPrebid = mock(Prebid.class);
    when(mockPrebid.getTargeting()).thenReturn(new HashMap<>());
    when(mockBid.getPrebid()).thenReturn(mockPrebid);
    when(mockBid.getPrice()).thenReturn(0.2);
    mEventHandler.requestAdWithBid(mockBid);
    assertTrue(getExpectingAppEventStatus());
    when(mockBid.getPrice()).thenReturn(0.0);
    mEventHandler.requestAdWithBid(mockBid);
    assertFalse(getExpectingAppEventStatus());
    mEventHandler.requestAdWithBid(null);
    assertFalse(getExpectingAppEventStatus());
}
Also used : Prebid(org.prebid.mobile.rendering.bidding.data.bid.Prebid) Bid(org.prebid.mobile.rendering.bidding.data.bid.Bid) Test(org.junit.Test)

Example 3 with Prebid

use of org.prebid.mobile.rendering.bidding.data.bid.Prebid in project prebid-mobile-android by prebid.

the class GamRewardedEventHandlerTest method requestAdWithDifferentBids_VerifyAdStatus.

@Test
public void requestAdWithDifferentBids_VerifyAdStatus() {
    final Bid mockBid = mock(Bid.class);
    final Prebid mockPrebid = mock(Prebid.class);
    when(mockPrebid.getTargeting()).thenReturn(new HashMap<>());
    when(mockBid.getPrebid()).thenReturn(mockPrebid);
    when(mockBid.getPrice()).thenReturn(0.2);
    mEventHandler.requestAdWithBid(mockBid);
    assertTrue(getExpectingAppEventStatus());
    when(mockBid.getPrice()).thenReturn(0.0);
    mEventHandler.requestAdWithBid(mockBid);
    assertFalse(getExpectingAppEventStatus());
    mEventHandler.requestAdWithBid(null);
    assertFalse(getExpectingAppEventStatus());
}
Also used : Prebid(org.prebid.mobile.rendering.bidding.data.bid.Prebid) Bid(org.prebid.mobile.rendering.bidding.data.bid.Bid) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 Bid (org.prebid.mobile.rendering.bidding.data.bid.Bid)3 Prebid (org.prebid.mobile.rendering.bidding.data.bid.Prebid)3