Skip to content

Commit

Permalink
🔍 unitest subsrcribe.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jedsada Tiwongvorakul committed Apr 29, 2017
1 parent ac91010 commit c5ee156
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.times;
Expand Down Expand Up @@ -169,10 +170,21 @@ public void testRxBusUnRegister() throws Exception {
verify(RxBus.get(), times(1)).unregister(presenter);
}


@Test
public void testViewDestroy() throws Exception {
presenter.onViewDestroy();
verify(mockView).showMessage(R.string.view_destroy);
}

@Test
public void testSetResultBusTestBusEvent() {
presenter.busTestObj(new TestBusEvent());
verify(mockView, times(1)).showResultBusTestBusEvent(any(TestBusEvent.class));
}

@Test
public void testSetResultBusTag() {
presenter.busTestTag(anyInt());
verify(mockView, times(1)).showResultBusTag(anyInt());
}
}

0 comments on commit c5ee156

Please sign in to comment.