Skip to content

Commit

Permalink
Add one more unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
zsxwing committed Sep 26, 2013
1 parent 0b76496 commit bdddee6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions rxjava-core/src/test/java/rx/ObservableTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,20 @@ public void testContains() {
verify(aObserver, times(1)).onCompleted();
}

@Test
public void testContainsWithInexistence() {
Observable<Boolean> observable = Observable.from("a", "b", null).contains("c");

@SuppressWarnings("unchecked")
Observer<Object> aObserver = mock(Observer.class);
observable.subscribe(aObserver);
verify(aObserver, times(1)).onNext(false);
verify(aObserver, never()).onNext(true);
verify(aObserver, never()).onError(
org.mockito.Matchers.any(Throwable.class));
verify(aObserver, times(1)).onCompleted();
}

@Test
public void testContainsWithNull() {
Observable<Boolean> observable = Observable.from("a", "b", null).contains(null);
Expand Down

0 comments on commit bdddee6

Please sign in to comment.