Beispiel #1
0
 @Test
 public void testExtend() {
   final TestSubscriber<Object> subscriber = new TestSubscriber<>();
   final Object value = new Object();
   Observable.just(value)
       .to(
           onSubscribe -> {
             onSubscribe.subscribe(subscriber);
             subscriber.assertNoErrors();
             subscriber.assertComplete();
             subscriber.assertValue(value);
             return subscriber.values().get(0);
           });
 }
Beispiel #2
0
 @Test
 public void testAmbWith() {
   TestSubscriber<Integer> ts = new TestSubscriber<>();
   Observable.just(1).ambWith(Observable.just(2)).subscribe(ts);
   ts.assertValue(1);
 }