@Test public void execute_withImageUri_shouldShowUserDownloadImageAlert() throws Exception { params.put(URI_KEY, EXPECTED_FILE); subject.execute(); verify(mraidDisplayController).showUserDownloadImageAlert(eq(EXPECTED_FILE)); }
@Test public void execute_withMissingUriKey_shouldFireErrorEvent() throws Exception { // don't add URI_KEY to params subject.execute(); verify(mraidView).fireErrorEvent(eq(STORE_PICTURE), anyString()); verify(mraidDisplayController, never()).showUserDownloadImageAlert(anyString()); }
@Test public void execute_withEmptyUriKey_shouldFireErrorEvent() throws Exception { params.put(URI_KEY, ""); subject.execute(); verify(mraidView).fireErrorEvent(eq(STORE_PICTURE), anyString()); verify(mraidDisplayController, never()).showUserDownloadImageAlert(anyString()); }