def testMove(self): ms = StubExplosionMovingStrategy() explosion = Explosion(2) explosion.setMovingStrategy(ms) self.assertFalse(ms.moveExplosionCall) explosion.move(5) self.assertTrue(ms.moveExplosionCall) self.assertEquals(explosion, ms.exlosion) self.assertEquals(5, ms.dx)
def testMoveBowingExplosion(self): explosion = Explosion(2) explosion.setMovingStrategy(StubExplosionMovingStrategy()) explosion.setBlowingObject(StubBlowingObject()) explosion.blow() self.assertRaises(ExplosionError, lambda: explosion.move(1))