def setUp(self): self.testcar = car.Car(1, 2, 1)
def setUp(self): self.testcar = car.Car(1, 2, 1) self.testcar2 = car.Car(1, 4, 2) self.testcar3 = car.Car(2, 2, 3) self.testcar4 = car.Car(2, 5, 4)
def test_placeCar_at_random_place(self): self.testMap.placeCar(1, 1, c.Car(2, 2, 1)) for i in range(2): for j in range(2): self.assertEqual(self.testMap.getCar(1 + i, 1 + j).getId(), 1)
def test_placeCar_at_0_2(self): self.testMap.placeCar(0, 0, c.Car(4, 2, 1)) for i in range(3): for j in range(2): self.assertEqual(self.testMap.getCar(i, j).getId(), 1)
def test_placeCar_2xSized_car_at_0(self): self.testMap.placeCar(0, 0, c.Car(2, 1, 1)) self.assertEqual(self.testMap.getCar(0, 0).getId(), 1) self.assertEqual(self.testMap.getCar(1, 0).getId(), 1)
def test_placeCar_oneSized_car(self): self.testMap.placeCar(0, 0, c.Car(1, 1, 1)) self.assertEqual(self.testMap.getCar(0, 0).getId(), 1)