@Override public Solo<Integer> call() throws Exception { return Solo.just(++i); } });
@SuppressWarnings("unchecked") @Test public void zipError1() { Solo.zip(Arrays.asList(Solo.error(new IOException()), Solo.just(2)), new Function<Object[], Object>() { @Override public Object apply(Object[] a) throws Exception { return "" + a[0] + a[1]; } }) .test() .assertFailure(IOException.class); }
@Test public void blockingSubscribeThreeArg() { Solo.just(1).blockingSubscribe(this, this, this); assertEquals(2, count); }
@SuppressWarnings("unchecked") @Test public void zipArrayError1() { Solo.zipArray(new Function<Object[], Object>() { @Override public Object apply(Object[] a) throws Exception { return "" + a[0] + a[1]; } }, Solo.error(new IOException()), Solo.just(2)) .test() .assertFailure(IOException.class); }
@SuppressWarnings("unchecked") @Test public void zipArrayError2() { Solo.zipArray(new Function<Object[], Object>() { @Override public Object apply(Object[] a) throws Exception { return "" + a[0] + a[1]; } }, Solo.just(1), Solo.error(new IOException())) .test() .assertFailure(IOException.class); }
@Test public void andThenPublisherError() { Solo.just(1).andThen(Flowable.<Integer>error(new IOException())) .test() .assertFailure(IOException.class, 1); }
@Test public void concatWithError() { Solo.just(1).concatWith(Solo.<Integer>error(new IOException())) .test() .assertFailure(IOException.class, 1); }
@Test public void mergeWithError() { Solo.just(1).mergeWith(Solo.<Integer>error(new IOException())) .test() .assertFailure(IOException.class, 1); }
@Test public void fromPublisherSolo() { Solo.fromPublisher(Solo.just(1)) .test() .assertResult(1); }
@Test public void subscribeWith() { TestSubscriber<Integer> ts = Solo.just(1) .subscribeWith(new TestSubscriber<Integer>()); ts.assertResult(1); }
@Test public void flatMapError() { Solo.just(1).flatMap(Functions.justFunction(Solo.error(new IOException()))) .test() .assertFailure(IOException.class); }
@Test public void doAfterTerminate() { Solo.just(1) .doAfterTerminate(this) .test() .assertResult(1); assertEquals(1, count); }