MoPubActivity extends BaseInterstitialActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); broadcastAction(this, getBroadcastIdentifier(), ACTION_INTERSTITIAL_SHOW); }  static void start(Context context, String htmlData, boolean isScrollable, String redirectUrl, String clickthroughUrl, AdConfiguration adConfiguration); @Override View getAdView();  }
@Test public void onCreate_shouldSetContentView() throws Exception { subject.onCreate(null); assertThat(getContentView().getChildCount()).isEqualTo(1); }
@Test public void onCreate_shouldLayoutWebView() throws Exception { subject.onCreate(null); ArgumentCaptor<FrameLayout.LayoutParams> captor = ArgumentCaptor.forClass(FrameLayout.LayoutParams.class); verify(htmlInterstitialWebView).setLayoutParams(captor.capture()); FrameLayout.LayoutParams actualLayoutParams = captor.getValue(); assertThat(actualLayoutParams.width).isEqualTo(FrameLayout.LayoutParams.MATCH_PARENT); assertThat(actualLayoutParams.height).isEqualTo(FrameLayout.LayoutParams.MATCH_PARENT); }
@Test public void onCreate_shouldBroadcastInterstitialShow() throws Exception { Intent expectedIntent = getIntentForActionAndIdentifier(ACTION_INTERSTITIAL_SHOW, testBroadcastIdentifier); ShadowLocalBroadcastManager.getInstance(subject).registerReceiver(broadcastReceiver, getHtmlInterstitialIntentFilter()); subject.onCreate(null); verify(broadcastReceiver).onReceive(any(Context.class), eq(expectedIntent)); }