def test_bear_off_and_hit(self): board = Board( repeat_point(22) + [Point(1, Color.White)] + [Point(1, Color.Black)]) board.apply_move(Move(Color.White, 23, 1)) self.assertEqual(board.bar[Color.Black.value], 1) board.apply_move(Move(Color.White, 24, 1)) self.assertEqual(board.off[Color.White.value], 1)
def test_simple_hit(self): board = Board([Point(2, Color.White)] + [Point(1, Color.Black)] + repeat_point(22)) board.apply_move(Move(Color.White, 1, 1)) self.assertEqual(board.bar[Color.Black.value], 1)
def test_simple_move(self): board = Board([Point(2, Color.White)] + repeat_point(23)) board.apply_move(Move(Color.White, 1, 6)) self.assertEqual(board.point_at_number(1), Point(1, Color.White)) self.assertEqual(board.point_at_number(7), Point(1, Color.White))