File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
rxjava-core/src/test/java/rx Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -755,6 +755,20 @@ public void testContains() {
755
755
verify (aObserver , times (1 )).onCompleted ();
756
756
}
757
757
758
+ @ Test
759
+ public void testContainsWithInexistence () {
760
+ Observable <Boolean > observable = Observable .from ("a" , "b" , null ).contains ("c" );
761
+
762
+ @ SuppressWarnings ("unchecked" )
763
+ Observer <Object > aObserver = mock (Observer .class );
764
+ observable .subscribe (aObserver );
765
+ verify (aObserver , times (1 )).onNext (false );
766
+ verify (aObserver , never ()).onNext (true );
767
+ verify (aObserver , never ()).onError (
768
+ org .mockito .Matchers .any (Throwable .class ));
769
+ verify (aObserver , times (1 )).onCompleted ();
770
+ }
771
+
758
772
@ Test
759
773
public void testContainsWithNull () {
760
774
Observable <Boolean > observable = Observable .from ("a" , "b" , null ).contains (null );
You can’t perform that action at this time.
0 commit comments