Result.Err.equals(): test when error is different

This commit is contained in:
Paul Campbell 2018-06-26 22:18:32 +01:00
parent 3e80dded1d
commit 1e85a14165

View file

@ -15,6 +15,7 @@ public class ResultTest implements WithAssertions {
final RuntimeException runtimeException = new RuntimeException();
assertThat(Result.ok(1)).isNotEqualTo(Result.error(runtimeException));
assertThat(Result.error(runtimeException)).isEqualTo(Result.error(runtimeException));
assertThat(Result.error(runtimeException)).isNotEqualTo(Result.error(new RuntimeException()));
assertThat(Result.ok(1).equals("1")).isFalse();
assertThat(Result.error(new RuntimeException()).equals("1")).isFalse();
}