@Test public void invalidate_shouldCauseBannerListenerMethodsToDoNothing() throws Exception { subject.invalidate(); subject.onBannerLoaded(null); subject.onBannerFailed(null); subject.onBannerExpanded(); subject.onBannerCollapsed(); subject.onBannerClicked(); subject.onLeaveApplication(); verify(moPubView, never()).nativeAdLoaded(); verify(moPubView, never()).setAdContentView(any(View.class)); verify(moPubView, never()).trackNativeImpression(); verify(moPubView, never()).loadFailUrl(any(MoPubErrorCode.class)); verify(moPubView, never()).setAutorefreshEnabled(any(boolean.class)); verify(moPubView, never()).adClosed(); verify(moPubView, never()).registerClick(); }
@Override public void onLeaveApplication() { onBannerClicked(); }
@Test public void onBannerClicked_shouldRegisterClick() throws Exception { subject.onBannerClicked(); verify(moPubView).registerClick(); }