コード例 #1
0
  @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();
  }
コード例 #2
0
 @Override
 public void onLeaveApplication() {
   onBannerClicked();
 }
コード例 #3
0
  @Test
  public void onBannerClicked_shouldRegisterClick() throws Exception {
    subject.onBannerClicked();

    verify(moPubView).registerClick();
  }