@Test public void testGetOriginalContentPosition_1stAdAt0_Position110_Result100() throws Exception { setupAdmobAdapterCalculatorHelper(10, 0, 10); assertThat(admobAdapterCalculator.getOriginalContentPosition(110, 10, 100), is(100)); }
public int getOriginalContentPosition(int position, int fetchedAdsCount, int sourceItemsCount) { int noOfAds = getAdsCountToPublish(fetchedAdsCount, sourceItemsCount); int adSpacesCount = (getAdIndex(position) + 1); int originalPosition = position - Math.min(adSpacesCount, noOfAds); return originalPosition; }
AdmobAdapterCalculator { public int getOriginalContentPosition(int position, int fetchedAdsCount, int sourceItemsCount) { int noOfAds = getAdsCountToPublish(fetchedAdsCount, sourceItemsCount); int adSpacesCount = (getAdIndex(position) + 1); int originalPosition = position - Math.min(adSpacesCount, noOfAds); return originalPosition; } }
AdmobAdapterCalculator { public int getOriginalContentPosition(int position, int fetchedAdsCount, int sourceItemsCount) { int noOfAds = getAdsCountToPublish(fetchedAdsCount, sourceItemsCount); int adSpacesCount = (getAdIndex(position) + 1); int originalPosition = position - Math.min(adSpacesCount, noOfAds); return originalPosition; }  }
AdmobAdapterCalculator { public int getOriginalContentPosition(int position, int fetchedAdsCount, int sourceItemsCount) { int noOfAds = getAdsCountToPublish(fetchedAdsCount, sourceItemsCount); int adSpacesCount = (getAdIndex(position) + 1); int originalPosition = position - Math.min(adSpacesCount, noOfAds); return originalPosition; }  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 int getOriginalContentPosition(int position, int fetchedAdsCount, int sourceItemsCount) { int noOfAds = getAdsCountToPublish(fetchedAdsCount, sourceItemsCount); int adSpacesCount = (getAdIndex(position) + 1); int originalPosition = position - Math.min(adSpacesCount, noOfAds); return originalPosition; }  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);  }