public void TestPotion() { IHealthModifier badPotion = new SimplePotion("Bad potion", -20); IHealthModifier goodPotion = new SimplePotion("GoodPotion", 15); badPotion.UseOn(PLAYER); goodPotion.UseOn(PLAYER); Assert.AreEqual(PLAYER.Health, 95); }
public void TestHealthOverflow() { IHealthModifier goodPotion = new SimplePotion("GoodPotion", 20); for (int i = 0; i < 6; i++) { goodPotion.UseOn(PLAYER); } Assert.AreEqual(PLAYER.Health, 100); }
public void TestHealthUnderflow() { IHealthModifier badPotion = new SimplePotion("Bad potion", -20); for (int i = 0; i < 6; i++) { badPotion.UseOn(PLAYER); } Assert.AreEqual(PLAYER.Health, 0); Assert.IsFalse(PLAYER.IsAlive()); }