@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(); }
@Test public void onLeaveApplication_shouldRegisterClick() throws Exception { subject.onLeaveApplication(); verify(moPubView).registerClick(); }