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

    StaticPage staticPage1 = new StaticPage("admin", "html content", true);

    assertTrue(staticPage1.equals(staticPage1));
  }
Ejemplo n.º 2
0
  @Test
  public void hashCodeShouldNotBeEqual() {

    StaticPage staticPage1 = new StaticPage("admin", "html content", true);
    StaticPage staticPage2 = new StaticPage("contact", "html content 2", false);

    assertNotSame(staticPage1.hashCode(), staticPage2.hashCode());
  }
Ejemplo n.º 3
0
  @Test
  public void equalsReturnsFalseWhenNotEqual() {

    StaticPage staticPage1 = new StaticPage("admin", "html content", true);
    StaticPage staticPage2 = new StaticPage("admin", "html content 2", true);

    assertFalse(staticPage1.equals(staticPage2));
  }
Ejemplo n.º 4
0
  @Test
  public void hashCodeShouldBeEqual() {

    StaticPage staticPage1 = new StaticPage("admin", "html content", true);
    assertEquals(staticPage1.hashCode(), staticPage1.hashCode());
  }