Skip to content

Instantly share code, notes, and snippets.

@deepakazad
Created July 5, 2017 06:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deepakazad/1678341a8a06fbf5f25c5760219fe79e to your computer and use it in GitHub Desktop.
Save deepakazad/1678341a8a06fbf5f25c5760219fe79e to your computer and use it in GitHub Desktop.
public class RxJavaExceptionTestingTest {
private RxJavaExceptionTesting exceptionTesting;
@Before
public void initialize(){
exceptionTesting = new RxJavaExceptionTesting();
}
@Test
public void foo1() throws Exception {
exceptionTesting.foo1()
.test()
.assertNoErrors();
}
@Test
public void foo2() throws Exception {
exceptionTesting.foo2()
.test()
.assertError(MyException.class)
.assertError(new MyException());
}
@Test
public void foo3() throws Exception {
exceptionTesting.foo3()
.test()
.assertError(MyException.class)
.assertError(throwable -> "This is a custom exception.".equals(throwable.getMessage()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment