Ejemplo n.º 1
0
  @Test
  public void shouldNotBeEqualToAnotherPositionIfTheirCodesAreNotEqual() {

    JobPosition other = new JobPosition(position.getCode() + "X");

    assertThat(position, is(not(equalTo(other))));
  }
Ejemplo n.º 2
0
  @Test
  public void equalsAnotherPositionWithTheSameCode() {

    JobPosition other = new JobPosition(position.getCode());

    assertThat(position, is(equalTo(other)));
    assertThat(position.hashCode(), is(other.hashCode()));
  }