示例#1
0
 def test_move_result_up(self):
     square = Square(0, 0)
     coords = square.coordinates
     results = square.move_result(Direction.Up)
     self.assertEqual(results,
                      [Coordinate(0, 1),
                       Coordinate(1, 1),
                       Coordinate(1, 0),
                       Coordinate(0, 0)])
     self.assertEqual(coords,
                      [Coordinate(0, 0),
                       Coordinate(1, 0),
                       Coordinate(1, -1),
                       Coordinate(0, -1)])
示例#2
0
 def test_move_result_right(self):
     square = Square(0, 0)
     coords = square.coordinates
     results = square.move_result(Direction.Right)
     self.assertEqual(results,
                      [Coordinate(1, 0),
                       Coordinate(2, 0),
                       Coordinate(2, -1),
                       Coordinate(1, -1)])
     self.assertEqual(coords,
                      [Coordinate(0, 0),
                       Coordinate(1, 0),
                       Coordinate(1, -1),
                       Coordinate(0, -1)])
示例#3
0
 def test_move_result_down(self):
     """
     Move result should give coordinate like move but actual coords should not change
     """
     square = Square(0, 0)
     coords = square.coordinates
     results = square.move_result(Direction.Down)
     self.assertEqual(results,
                      [Coordinate(0, -1),
                       Coordinate(1, -1),
                       Coordinate(1, -2),
                       Coordinate(0, -2)])
     self.assertEqual(coords,
                      [Coordinate(0, 0),
                       Coordinate(1, 0),
                       Coordinate(1, -1),
                       Coordinate(0, -1)])