Exemplo n.º 1
0
 def test_two_adjacent_rooms(self):
     a, b = Room(width=2, height=2), Room(width=2, height=2)
     coordinates = [(0, 0, 2, 0), (0, 2, 0, 0), (0, 0, 1, 2)]
     for coordinate_set in coordinates:
         a.x, a.y, b.x, b.y = coordinate_set
         self.assertTrue(_rooms_adjacent(a, b))
Exemplo n.º 2
0
 def test_two_overlapping_rooms(self):
     a, b = Room(width=2, height=2), Room(width=2, height=2)
     coordinates = [(0, 0, 1, 1), (2, 2, 1, 1), (0, 0, 0, 1)]
     for coordinate_set in coordinates:
         a.x, a.y, b.x, b.y = coordinate_set
         self.assertFalse(_rooms_adjacent(a, b))
Exemplo n.º 3
0
 def test_two_unadjacent_rooms(self):
     a, b = Room(width=1, height=1), Room(width=1, height=1)
     coordinates = [(0, 0, 1, 1), (1, 1, 0, 0), (0, 0, 4, 4)]
     for coordinate_set in coordinates:
         a.x, a.y, b.x, b.y = coordinate_set
         self.assertFalse(_rooms_adjacent(a, b))