def test_trim_board(self):
     board = BaseBoard(3)
     board.make_move(4,"x")
     board.make_move(9,"o")
     board_string = board.__str__()
     expected = "   x    o"
     self.assertEqual(expected,self.formatter.trim_board(board_string))
Ejemplo n.º 2
0
 def test_trim_board(self):
     board = BaseBoard(3)
     board.make_move(4, "x")
     board.make_move(9, "o")
     board_string = board.__str__()
     expected = "   x    o"
     self.assertEqual(expected, self.formatter.trim_board(board_string))
 def test_format_for_speech(self):
     board = BaseBoard(3)
     board.board_state = {1:"x", 8:"o", 9:"x"}
     board_string = board.__str__()
     row_one = " row 1 x  empty  empty"
     row_two = " row 2 empty  empty  empty"
     row_three = " row 3 empty  o  x"
     expected = (row_one + row_two + row_three)
     self.assertEqual(expected,self.formatter.format_for_speech(board_string))
Ejemplo n.º 4
0
 def test_format_for_speech(self):
     board = BaseBoard(3)
     board.board_state = {1: "x", 8: "o", 9: "x"}
     board_string = board.__str__()
     row_one = " row 1 x  empty  empty"
     row_two = " row 2 empty  empty  empty"
     row_three = " row 3 empty  o  x"
     expected = (row_one + row_two + row_three)
     self.assertEqual(expected,
                      self.formatter.format_for_speech(board_string))
 def test_format_for_speech_with_fours_board(self):
     board = BaseBoard(4)
     board.board_state = {1:"x", 8:"o", 9:"x"}
     board_string = board.__str__()
     row_one = " row 1 x  empty  empty  empty"
     row_two = " row 2 empty  empty  empty  o"
     row_three = " row 3 x  empty  empty  empty"
     row_four = " row 4 empty  empty  empty  empty"
     expected = (row_one + row_two + row_three + row_four)
     self.assertTrue(self.fours_formatter.is_board_string(board_string))
     self.assertEqual(expected,self.fours_formatter.format_for_speech(board_string))
Ejemplo n.º 6
0
 def test_format_for_speech_with_fours_board(self):
     board = BaseBoard(4)
     board.board_state = {1: "x", 8: "o", 9: "x"}
     board_string = board.__str__()
     row_one = " row 1 x  empty  empty  empty"
     row_two = " row 2 empty  empty  empty  o"
     row_three = " row 3 x  empty  empty  empty"
     row_four = " row 4 empty  empty  empty  empty"
     expected = (row_one + row_two + row_three + row_four)
     self.assertTrue(self.fours_formatter.is_board_string(board_string))
     self.assertEqual(expected,
                      self.fours_formatter.format_for_speech(board_string))