Пример #1
0
 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)
Пример #2
0
 def testMoveBowingExplosion(self):
     explosion = Explosion(2)
     explosion.setMovingStrategy(StubExplosionMovingStrategy())
     explosion.setBlowingObject(StubBlowingObject())
     explosion.blow()
     self.assertRaises(ExplosionError, lambda: explosion.move(1))