@Test(expected = IllegalArgumentException.class) public void shouldThrowException_WhenNoParameters() throws Exception { when(network.isConnected()).thenReturn(true); when(view.extractTitle()).thenReturn(null); when(view.extractUrl()).thenReturn(null); presenter.onViewCreated(); }
public void onViewCreated() { if (network.isConnected()) { String title = view.extractTitle(); String url = view.extractUrl(); parametersPrecondition(title, url); view.setupToolbarTitle(title); view.loadExternalUrl(url); } else { view.showNoConnectionWarning(); } }
ExternalViewPresenter { public void onViewCreated() { if (network.isConnected()) { String title = view.extractTitle(); String url = view.extractUrl(); parametersPrecondition(title, url); view.setupToolbarTitle(title); view.loadExternalUrl(url); } else { view.showNoConnectionWarning(); } } }
ExternalViewPresenter { public void onViewCreated() { if (network.isConnected()) { String title = view.extractTitle(); String url = view.extractUrl(); parametersPrecondition(title, url); view.setupToolbarTitle(title); view.loadExternalUrl(url); } else { view.showNoConnectionWarning(); } } ExternalViewPresenter(View view, NetworkConnectivity network); }
ExternalViewPresenter { public void onViewCreated() { if (network.isConnected()) { String title = view.extractTitle(); String url = view.extractUrl(); parametersPrecondition(title, url); view.setupToolbarTitle(title); view.loadExternalUrl(url); } else { view.showNoConnectionWarning(); } } ExternalViewPresenter(View view, NetworkConnectivity network); void onViewCreated(); }
ExternalViewPresenter { public void onViewCreated() { if (network.isConnected()) { String title = view.extractTitle(); String url = view.extractUrl(); parametersPrecondition(title, url); view.setupToolbarTitle(title); view.loadExternalUrl(url); } else { view.showNoConnectionWarning(); } } ExternalViewPresenter(View view, NetworkConnectivity network); void onViewCreated();  }