Add tests for equality
This commit is contained in:
parent
dc89a0962f
commit
d082215b12
1 changed files with 9 additions and 0 deletions
|
@ -32,6 +32,15 @@ public class MaybeTest {
|
||||||
assertThat(nothing()).isSameAs(nothing());
|
assertThat(nothing()).isSameAs(nothing());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void equality() {
|
||||||
|
assertThat(just(1)).isEqualTo(just(1));
|
||||||
|
assertThat(just(1)).isNotEqualTo(just(2));
|
||||||
|
assertThat(just(1)).isNotEqualTo(nothing());
|
||||||
|
assertThat(nothing()).isEqualTo(nothing());
|
||||||
|
assertThat(just(1).equals("1")).isFalse();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void maybeAllowsNull() {
|
public void maybeAllowsNull() {
|
||||||
assertThat(just(1)).isEqualTo(maybe(1));
|
assertThat(just(1)).isEqualTo(maybe(1));
|
||||||
|
|
Loading…
Reference in a new issue