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

    notification = new Notification(notification.getMessage(), null);
    Notification other = new Notification(notification.getMessage(), null);

    assertEquals(notification, other);
  }
Ejemplo n.º 2
0
  @Test
  public void twoNotificationsShouldBeEqualIfTheyWrapEqualMessagesAndEqualDetails() {

    Notification other = new Notification(notification.getMessage(), notification.getDetail());

    assertEquals(notification, other);
    assertThat(notification.hashCode(), is(equalTo(other.hashCode())));
  }
Ejemplo n.º 3
0
  @Test
  public void twoNotificationsShouldNotBeEqualIfTheyWrapUnequalMessages() {

    Notification other =
        new Notification(notification.getMessage() + "Y", notification.getDetail());

    assertNotEquals(notification, other);
  }