コード例 #1
0
 def test_get_floor_prioritize_null_called_floor(self):
     lift = LiftLogic()
     self.assertEqual(None, lift.getFloor(1, None, None))
コード例 #2
0
 def test_getFloor_prioritize_closest_floor_equal_distance_first_in_list_above(self):
     lift = LiftLogic()
     self.assertEqual(1, lift.getFloor(1, None, [3, 1]))
コード例 #3
0
 def test_get_floor_prioritize_closest_floor_below(self):
     lift = LiftLogic()
     self.assertEqual(1, lift.getFloor(3, None, [1, 7]))
コード例 #4
0
 def test_get_floor_prioritize_closest_floor_above(self):
     lift = LiftLogic()
     self.assertEqual(2, lift.getFloor(0, None, [-3, 2]))
コード例 #5
0
 def test_get_floor_prioritize_called_floor(self):
     lift = LiftLogic()
     self.assertEqual(1, lift.getFloor(1, 1, [2]))
コード例 #6
0
 def test_get_floor_prioritize_empty_list(self):
     lift = LiftLogic()
     self.assertEqual(None, lift.getFloor(1, None, []))