def test_quantity_rook(self): x = 0 y = 0 for i in range(0, 9): for j in range(0, 9): x = x + my_board.final_board()[i][j].count("Rv") y = y + my_board.final_board()[i][j].count("R^") self.assertEqual(1, y) self.assertEqual(1, x) self.assertEqual("Rv", my_board.final_board()[1][1]) self.assertEqual("R^", my_board.final_board()[7][1])
def test_quantity_king(self): x = 0 y = 0 for i in range(0, 9): for j in range(0, 9): x = x + my_board.final_board()[i][j].count("Kv") y = y + my_board.final_board()[i][j].count("K^") self.assertEqual(1, y) self.assertEqual(1, x) self.assertEqual("Kv", my_board.final_board()[0][4]) self.assertEqual("K^", my_board.final_board()[8][4])
def test_quantity_silver_general(self): x = 0 y = 0 for i in range(0, 9): for j in range(0, 9): x = x + my_board.final_board()[i][j].count("Sv") y = y + my_board.final_board()[i][j].count("S^") self.assertEqual(2, y) self.assertEqual(2, x) self.assertEqual("Sv", my_board.final_board()[0][2]) self.assertEqual("Sv", my_board.final_board()[0][6]) self.assertEqual("S^", my_board.final_board()[8][2]) self.assertEqual("S^", my_board.final_board()[8][6])
def test_quantity_gold_general(self): x = 0 y = 0 for i in range(0, 9): for j in range(0, 9): x = x + my_board.final_board()[i][j].count("Gv") y = y + my_board.final_board()[i][j].count("G^") self.assertEqual(2, y) self.assertEqual(2, x) self.assertEqual("Gv", my_board.final_board()[0][3]) self.assertEqual("Gv", my_board.final_board()[0][5]) self.assertEqual("G^", my_board.final_board()[8][3]) self.assertEqual("G^", my_board.final_board()[8][5])
def test_quantity_lancer(self): x = 0 y = 0 for i in range(0, 9): for j in range(0, 9): x = x + my_board.final_board()[i][j].count("Lv") y = y + my_board.final_board()[i][j].count("L^") self.assertEqual(2, y) self.assertEqual(2, x) self.assertEqual("Lv", my_board.final_board()[0][0]) self.assertEqual("Lv", my_board.final_board()[0][8]) self.assertEqual("L^", my_board.final_board()[8][0]) self.assertEqual("L^", my_board.final_board()[8][8])
def test_quantity_hourse(self): x = 0 y = 0 for i in range(0, 9): for j in range(0, 9): x = x + my_board.final_board()[i][j].count("Hv") y = y + my_board.final_board()[i][j].count("H^") self.assertEqual(2, y) self.assertEqual(2, x) self.assertEqual("Hv", my_board.final_board()[0][1]) self.assertEqual("Hv", my_board.final_board()[0][7]) self.assertEqual("H^", my_board.final_board()[8][1]) self.assertEqual("H^", my_board.final_board()[8][7])
def test_board(self): self.assertEqual(len(my_board.final_board()), 9)
def test_white_powns(self): for i in range(0, 9): with self.subTest(i=i): self.assertIn("P^", my_board.final_board()[6][i])