|
@ -31,4 +31,16 @@ class ChessFigureTest { |
|
|
assertEquals("|Z|", new ChessFigure(ChessFigure.Type.KNIGHT, ChessFigure.Team.BLACK).getSymbol()); |
|
|
assertEquals("|Z|", new ChessFigure(ChessFigure.Type.KNIGHT, ChessFigure.Team.BLACK).getSymbol()); |
|
|
assertEquals("|o|", new ChessFigure(ChessFigure.Type.PAWN, ChessFigure.Team.BLACK).getSymbol()); |
|
|
assertEquals("|o|", new ChessFigure(ChessFigure.Type.PAWN, ChessFigure.Team.BLACK).getSymbol()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void testEquals() { |
|
|
|
|
|
ChessFigure kw1 = new ChessFigure(ChessFigure.Type.KING, ChessFigure.Team.WHITE); |
|
|
|
|
|
ChessFigure kw2 = new ChessFigure(ChessFigure.Type.KING, ChessFigure.Team.WHITE); |
|
|
|
|
|
ChessFigure kb1 = new ChessFigure(ChessFigure.Type.KING, ChessFigure.Team.BLACK); |
|
|
|
|
|
ChessFigure pw1 = new ChessFigure(ChessFigure.Type.PAWN, ChessFigure.Team.WHITE); |
|
|
|
|
|
|
|
|
|
|
|
assertEquals(kw1, kw2); |
|
|
|
|
|
assertNotEquals(kw2, kb1); |
|
|
|
|
|
assertNotEquals(pw1, kb1); |
|
|
|
|
|
} |
|
|
} |
|
|
} |