Ejemplo n.º 1
0
 def testMoveCar(self):
     car = StubCar(1, 0, 1, 1)
     worldWidth = 10
     explosion = StubExplosion(2)
     cms = CarMovingStrategy(worldWidth, explosion)
     cms.moveCar(car, 2)
     self.assertEquals(3, car.getX())
     self.assertEquals(4, explosion.x)
Ejemplo n.º 2
0
 def testMoveCarRightOutOfWorld(self):
     car = StubCar(8, 0, 1, 1)
     worldWidth = 10
     explosion = StubExplosion(2)
     cms = CarMovingStrategy(worldWidth, explosion)
     cms.moveCar(car, 5)
     self.assertEquals(9, car.getX())
     self.assertEquals(3, explosion.x)