public void HealthPotionObject_ShouldIncreaseHealth_WhenUsed() { IWarriorHero dummy = ClassFactory.CreateWarrior("test"); dummy.HealthCurr = 50; IUseable <Item> potion = PotionFactory.CreateHealthPotion("test", 1, 50); dummy.Use(potion); Assert.AreEqual(dummy.HealthCurr, 100); }
public void UseMethod_ShouldUseItem_WhenCalled() { IWarriorHero dummy = ClassFactory.CreateWarrior("test"); dummy.HealthCurr = 1; double oldHealthCurr = dummy.HealthCurr; IUseable <Item> healthPotion = PotionFactory.CreateHealthPotion("test", 1, 50); dummy.Use(healthPotion); Assert.AreNotEqual(oldHealthCurr, dummy.HealthCurr); }