Adds hashCode tests.
@@ -79,6 +79,22 @@ public class AsciiCharacterTest {
Assert.assertFalse(characterA.equals(characterB));
}
+ @Test
+ public void testHashCode_withEqualCharacters() {
+ final AsciiCharacter characterA = new AsciiCharacter('A');
+ final AsciiCharacter characterB = new AsciiCharacter('A');
+
+ Assert.assertEquals(characterA.hashCode(), characterB.hashCode());
+ }
+
+ @Test
+ public void testHashCode_withNonEqualCharacters() {
+ final AsciiCharacter characterA = new AsciiCharacter('A');
+ final AsciiCharacter characterB = new AsciiCharacter('B');
+
+ Assert.assertNotEquals(characterA.hashCode(), characterB.hashCode());
+ }
+
@Test
public void testEnableBlinkEffect() {
final AsciiCharacter character = new AsciiCharacter('A');
