示例#1
0
  @Test
  public void shouldBeEqualIfHasSameFirstSecondAndThird() {
    // Given
    Triple<Integer, String, Boolean> triple1 = tuple(5, "Five", true);
    Triple<Integer, String, Boolean> triple2 = tuple(5, "Five", true);

    // When
    Boolean isEqual = triple1.equals(triple2);

    // Then
    assertThat(isEqual, is(true));
  }
示例#2
0
  @Test
  public void shouldNotBeEqualIfHasDifferentThird() {
    // Given
    Triple<Integer, String, Boolean> triple1 = tuple(5, "Five", true);
    Triple<Integer, String, Boolean> triple2 = tuple(5, "Five", false);

    // When
    Boolean isEqual = triple1.equals(triple2);

    // Then
    assertThat(isEqual, is(false));
  }
示例#3
0
  @Test
  public void shouldNotBeEqualIfNotATriple() throws Exception {
    // Given
    Triple<Integer, String, Boolean> triple = tuple(5, "Five", true);
    Iterable<Object> iterable = iterableBuilderOf(Object.class).with(5, "five", true).build();

    // When
    boolean firstDirection = triple.equals(iterable);
    boolean secondDirection = iterable.equals(triple);

    // Then
    assertThat(firstDirection, is(false));
    assertThat(secondDirection, is(false));
  }