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;
}
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());
}
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));
}
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));
}
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;
}
Aggregations