Search in sources :

Example 11 with AdSize

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

the class MediationBaseAdUnitTest method createAdUnit.

private MediationBaseAdUnit createAdUnit(String configId) {
    MediationBaseAdUnit baseAdUnit = new MediationBaseAdUnit(mContext, configId, mMockAdSize, new MockMediationUtils()) {

        @Override
        protected void initAdConfig(String configId, AdSize adSize) {
            mAdUnitConfig.setConfigId(configId);
        }
    };
    WhiteBox.setInternalState(baseAdUnit, "mBidLoader", mMockBidLoader);
    return baseAdUnit;
}
Also used : AdSize(org.prebid.mobile.rendering.bidding.data.AdSize) MockMediationUtils(org.prebid.mobile.rendering.bidding.config.MockMediationUtils)

Example 12 with AdSize

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

the class BannerViewTest method addAdditionalSizes_GetterAndAdUnitConfigContainSetValueAndInitialSize.

@Test
public void addAdditionalSizes_GetterAndAdUnitConfigContainSetValueAndInitialSize() {
    final AdSize adSize = new AdSize(10, 20);
    final Set<AdSize> expectedSet = new HashSet<>();
    // from eventHandler
    expectedSet.add(AD_SIZE);
    expectedSet.add(adSize);
    mBannerView.addAdditionalSizes(adSize);
    assertEquals(expectedSet, mBannerView.getAdditionalSizes());
}
Also used : AdSize(org.prebid.mobile.rendering.bidding.data.AdSize) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 13 with AdSize

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

the class AdUnitConfigurationTest method whenAddSize_SetContainsSize.

@Test
public void whenAddSize_SetContainsSize() {
    AdSize adSize = new AdSize(0, 0);
    assertTrue(mAdUnitConfig.getAdSizes().isEmpty());
    mAdUnitConfig.addSize(adSize);
    assertEquals(1, mAdUnitConfig.getAdSizes().size());
    assertTrue(mAdUnitConfig.getAdSizes().contains(adSize));
}
Also used : AdSize(org.prebid.mobile.rendering.bidding.data.AdSize) Test(org.junit.Test)

Example 14 with AdSize

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

the class AdUnitConfigurationTest method whenAddSizes_SetContainsSizes.

@Test
public void whenAddSizes_SetContainsSizes() {
    AdSize adSize = new AdSize(0, 0);
    AdSize adSize1 = new AdSize(1, 1);
    assertTrue(mAdUnitConfig.getAdSizes().isEmpty());
    mAdUnitConfig.addSizes(adSize, adSize1);
    assertEquals(2, mAdUnitConfig.getAdSizes().size());
    assertTrue(mAdUnitConfig.getAdSizes().contains(adSize));
    assertTrue(mAdUnitConfig.getAdSizes().contains(adSize1));
}
Also used : AdSize(org.prebid.mobile.rendering.bidding.data.AdSize) Test(org.junit.Test)

Example 15 with AdSize

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

the class PublisherAdViewWrapper method mapToGamAdSizes.

private com.google.android.gms.ads.AdSize[] mapToGamAdSizes(AdSize[] adSizes) {
    if (adSizes == null) {
        return new com.google.android.gms.ads.AdSize[0];
    }
    final com.google.android.gms.ads.AdSize[] gamAdSizeArray = new com.google.android.gms.ads.AdSize[adSizes.length];
    for (int i = 0; i < adSizes.length; i++) {
        final AdSize prebidAdSize = adSizes[i];
        gamAdSizeArray[i] = new com.google.android.gms.ads.AdSize(prebidAdSize.width, prebidAdSize.height);
    }
    return gamAdSizeArray;
}
Also used : AdSize(org.prebid.mobile.rendering.bidding.data.AdSize)

Aggregations

AdSize (org.prebid.mobile.rendering.bidding.data.AdSize)25 Test (org.junit.Test)15 AdConfiguration (org.prebid.mobile.rendering.models.AdConfiguration)15 BasicParameterBuilder (org.prebid.mobile.rendering.networking.parameters.BasicParameterBuilder)9 Imp (org.prebid.mobile.rendering.models.openrtb.bidRequests.Imp)6 Configuration (android.content.res.Configuration)4 BidRequest (org.prebid.mobile.rendering.models.openrtb.BidRequest)4 Banner (org.prebid.mobile.rendering.models.openrtb.bidRequests.imps.Banner)2 Video (org.prebid.mobile.rendering.models.openrtb.bidRequests.imps.Video)2 SuppressLint (android.annotation.SuppressLint)1 Context (android.content.Context)1 TypedArray (android.content.res.TypedArray)1 HashSet (java.util.HashSet)1 JSONArray (org.json.JSONArray)1 Before (org.junit.Before)1 MockMediationUtils (org.prebid.mobile.rendering.bidding.config.MockMediationUtils)1 Device (org.prebid.mobile.rendering.models.openrtb.bidRequests.Device)1 Ext (org.prebid.mobile.rendering.models.openrtb.bidRequests.Ext)1 User (org.prebid.mobile.rendering.models.openrtb.bidRequests.User)1 DeviceInfoManager (org.prebid.mobile.rendering.sdk.deviceData.managers.DeviceInfoManager)1