Skip to content

Commit

Permalink
More tests to MapEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriciofx committed Jun 26, 2017
1 parent 0015fb4 commit 3af1273
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/java/org/cactoos/list/MapEntryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,25 @@ public void getValue() {
public void cantSetValue() {
new MapEntry<>("one", "two").setValue("three");
}

@Test
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
public void equalsTo() {
MatcherAssert.assertThat(
"MapEntries are not equals",
new MapEntry<>("eo", "book").equals(new MapEntry<>("eo", "book")),
Matchers.equalTo(true)
);
}

@Test
public void compareHash() {
MatcherAssert.assertThat(
"the hash code are not equals",
new MapEntry<>("elegant", "objects").hashCode(),
// @checkstyle MagicNumber (1 line)
Matchers.equalTo(32739498)
);
}

}

0 comments on commit 3af1273

Please sign in to comment.