@Test public void testHasToFetchAd_position98_firstIdxIs99_Fail() throws Exception { setupAdmobAdapterCalculatorHelper(10, 99, 10); assertThat(admobAdapterCalculator.hasToFetchAd(98, 10), is(false)); }
public boolean hasToFetchAd(int position, int fetchingAdsCount){ int adIndex = getAdIndex(position); int firstAdPos = getOffsetValue(); return position >= firstAdPos && adIndex >= 0 && adIndex < getLimitOfAds() && adIndex >= fetchingAdsCount; }
AdmobAdapterCalculator { public boolean hasToFetchAd(int position, int fetchingAdsCount){ int adIndex = getAdIndex(position); int firstAdPos = getOffsetValue(); return position >= firstAdPos && adIndex >= 0 && adIndex < getLimitOfAds() && adIndex >= fetchingAdsCount; } }
AdmobAdapterCalculator { public boolean hasToFetchAd(int position, int fetchingAdsCount){ int adIndex = getAdIndex(position); int firstAdPos = getOffsetValue(); return position >= firstAdPos && adIndex >= 0 && adIndex < getLimitOfAds() && adIndex >= fetchingAdsCount; }  }
AdmobAdapterCalculator { public boolean hasToFetchAd(int position, int fetchingAdsCount){ int adIndex = getAdIndex(position); int firstAdPos = getOffsetValue(); return position >= firstAdPos && adIndex >= 0 && adIndex < getLimitOfAds() && adIndex >= fetchingAdsCount; }  int getNoOfDataBetweenAds(); void setNoOfDataBetweenAds(int mNoOfDataBetweenAds); int getFirstAdIndex(); void setFirstAdIndex(int firstAdIndex); int getLimitOfAds(); void setLimitOfAds(int mLimitOfAds); int getAdsCountToPublish(int fetchedAdsCount, int sourceItemsCount); int getOriginalContentPosition(int position, int fetchedAdsCount, int sourceItemsCount); int translateAdToWrapperPosition(int adPos); int translateSourceIndexToWrapperPosition(int sourcePos, int fetchedAdsCount); boolean canShowAdAtPosition(int position, int fetchedAdsCount); int getAdIndex(int position); boolean isAdPosition(int position); int getOffsetValue(); boolean isAdAvailable(int position, int fetchedAdsCount); boolean hasToFetchAd(int position, int fetchingAdsCount); }
AdmobAdapterCalculator { public boolean hasToFetchAd(int position, int fetchingAdsCount){ int adIndex = getAdIndex(position); int firstAdPos = getOffsetValue(); return position >= firstAdPos && adIndex >= 0 && adIndex < getLimitOfAds() && adIndex >= fetchingAdsCount; }  int getNoOfDataBetweenAds(); void setNoOfDataBetweenAds(int mNoOfDataBetweenAds); int getFirstAdIndex(); void setFirstAdIndex(int firstAdIndex); int getLimitOfAds(); void setLimitOfAds(int mLimitOfAds); int getAdsCountToPublish(int fetchedAdsCount, int sourceItemsCount); int getOriginalContentPosition(int position, int fetchedAdsCount, int sourceItemsCount); int translateAdToWrapperPosition(int adPos); int translateSourceIndexToWrapperPosition(int sourcePos, int fetchedAdsCount); boolean canShowAdAtPosition(int position, int fetchedAdsCount); int getAdIndex(int position); boolean isAdPosition(int position); int getOffsetValue(); boolean isAdAvailable(int position, int fetchedAdsCount); boolean hasToFetchAd(int position, int fetchingAdsCount);  }