public void TorpedoDestroysKlingon() { MockKlingon klingon = new MockKlingon(500, 200); context.SetValueForTesting("target", klingon); Game.generator = new MockRandom(); game.FireWeapon(context); Assert.AreEqual("Photons hit Klingon at 500 sectors with 825 units || Klingon destroyed! || ", context.GetAllOutput()); Assert.AreEqual(7, game.Torpedoes); Assert.IsTrue(klingon.DeleteWasCalled()); }
public void PhasersFiredKlingonDestroyed() { MockKlingon klingon = new MockKlingon(2000, 200); context.SetValueForTesting("amount", "1000"); context.SetValueForTesting("target", klingon); Game.generator = new MockRandom(); game.FireWeapon(context); Assert.AreEqual("Phasers hit Klingon at 2000 sectors with 400 units || Klingon destroyed! || ", context.GetAllOutput()); Assert.AreEqual(EnergyInNewGame - 1000, game.EnergyRemaining()); Assert.IsTrue(klingon.DeleteWasCalled()); }