def test_center_squares(self):
player_points = {'w': 0, 'b': 0}
#Initialized board
situation_a = Game()
center_squares(situation_a, player_points, 1)
self.assertEqual(player_points['b'], 0, "Should not have value since no piece is in any of the center squares")
self.assertEqual(player_points['w'], 0, "Should not have value since no piece is in any of the center squares")
situation_b = Game("r1bqkb1r/ppp1pppp/2n2n2/3p4/3PP3/2PQ4/PP3PPP/RNB1KBNR b KQkq e3 0 4")
center_squares(situation_b, player_points, 1)
self.assertEqual(player_points['b'], 5, "Should have points for 2 pieces in the outer square and 1 in the inner (5)")
self.assertEqual(player_points['w'], 8, "Should have points for 2 pieces in the outer square and 2 in the inner (8)")
评论列表
文章目录