Created
July 5, 2017 06:24
-
-
Save deepakazad/1678341a8a06fbf5f25c5760219fe79e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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