예제 #1
0
 @Test
 public void testMove() {
   q_w.move(4, 0);
   assertTrue(q_w.getX() == 4 && q_w.getY() == 0);
   p1_b.move(6, 3);
   assertFalse(p1_b.getX() == 6 && p1_b.getY() == 3);
   board.print();
 }
예제 #2
0
 @Test
 public void testCanGoTo() {
   assertTrue(p1_b.canGoTo(6, 3));
   assertFalse(p1_b.canGoTo(8, 7));
 }
예제 #3
0
 @Test
 public void testCanMoveTo() {
   assertTrue(p1_b.canMoveTo(6, 3));
 }
예제 #4
0
 @Test
 public void testCanEatAt() {
   assertTrue(q_w.canEatAt(4, 0));
   assertFalse(p1_b.canEatAt(7, 2));
 }
예제 #5
0
 @Test
 public void testGetY() {
   assertTrue(bs_w.getY() == 5);
   assertTrue(p1.getY() == 4);
   assertTrue(p1_b.getY() == 2);
 }
예제 #6
0
 @Test
 public void testGetX() {
   assertTrue(bs_w.getX() == 7);
   assertTrue(p1.getX() == 7);
   assertTrue(p1_b.getX() == 6);
 }
예제 #7
0
 @Test
 public void testGetType() {
   assertTrue(bs_w.getType() == ChessBoard.WHITE);
   assertTrue(p1.getType() == ChessBoard.WHITE);
   assertTrue(p1_b.getType() == ChessBoard.BLACK);
 }