CustomEventBannerAdapter implements CustomEventBannerListener { @Override public void onBannerExpanded() { if (isInvalidated()) return; mStoredAutorefresh = mMoPubView.getAutorefreshEnabled(); mMoPubView.setAutorefreshEnabled(false); mMoPubView.adPresentedOverlay(); } CustomEventBannerAdapter(MoPubView moPubView, String className, String classData); @Override void onBannerLoaded(View bannerView); @Override void onBannerFailed(MoPubErrorCode errorCode); @Override void onBannerExpanded(); @Override void onBannerCollapsed(); @Override void onBannerClicked(); @Override void onLeaveApplication(); static final int DEFAULT_BANNER_TIMEOUT_DELAY; }
@Test public void onBannerExpanded_shouldPauseRefreshAndCallAdPresentOverlay() throws Exception { subject.onBannerExpanded(); verify(moPubView).setAutorefreshEnabled(eq(false)); verify(moPubView).adPresentedOverlay(); }