public void PotionBagOnlyAllowsPotions() { var bag = new PotionSatchel(); Assert.IsTrue(bag.AddItem(new HealingPotion())); Assert.IsFalse(bag.AddItem(new GreatAxe())); }
public void PotionSatchelRequiresPotions() { PotionSatchel p = new PotionSatchel(); HealthPotion h = new HealthPotion(); GreatAxe g = new GreatAxe(); Assert.AreEqual(AddItemStatus.Ok, p.AddItem(h)); Assert.AreEqual(AddItemStatus.ItemWrongType, p.AddItem(g)); }
public static void SpecificContainerDemo() { // created a container that will only allow a specific type of item // this container only holds potions PotionSatchel potions = new PotionSatchel(); // adding a potion is fine and returns true Console.WriteLine($"Adding Healing Potion: {potions.AddItem(new HealingPotion())}"); // adding a non potion item fails and returns false in this case Console.WriteLine($"Adding Short Sword: {potions.AddItem(new ShortSword())}"); }
public void PotionSatchelOnlyAllowsPotions() { PotionSatchel ps = new PotionSatchel(); GreatAxe axe = new GreatAxe(); HealthPotion p = new HealthPotion(); AddItemStatus result = ps.AddItem(axe); Assert.AreEqual(AddItemStatus.ItemNotRightType, result); result = ps.AddItem(p); Assert.AreEqual(AddItemStatus.Success, result); }
public void PotionSatchelOnlyAllowsPotions() { PotionSatchel satchel = new PotionSatchel(); GreatAxe axe = new GreatAxe(); bool result = satchel.AddItem(axe); Assert.AreEqual(false, result); HealthPotion potion = new HealthPotion(); result = satchel.AddItem(potion); Assert.AreEqual(true, result); }
public void PotionSatchelOnlyAllowsPotions() { PotionSatchel satchel = new PotionSatchel(); Sword steelsword = new Sword(); AddItemStatus result = satchel.AddItem(steelsword); Assert.AreEqual(AddItemStatus.ItemNotRightType, result); HealthPotion potion = new HealthPotion(); result = satchel.AddItem(potion); Assert.AreEqual(AddItemStatus.Success, result); }
public void PotionSatchelOnlyAllowsPotions() { PotionSatchel satchel = new PotionSatchel(); GreatAxe axe = new GreatAxe(); AddItemStatus result = satchel.AddItem(axe); Assert.AreEqual(AddItemStatus.ItemWrongType, result); HealthPotion potion = new HealthPotion(); result = satchel.AddItem(potion); Assert.AreEqual(AddItemStatus.Success, result); }
public void PotionSatchelOnlyAllowsPotions() { PotionSatchel satchel = new PotionSatchel(); TurtleArmor armor = new TurtleArmor(); AddItemStatus result = satchel.AddItem(armor); Assert.AreEqual(AddItemStatus.ItemNotRightType, result); HealthPotion potion = new HealthPotion(); result = satchel.AddItem(potion); Assert.AreEqual(AddItemStatus.Success, result); }
public void RequiredItemType() { PotionSatchel b = new PotionSatchel(); Sword s = new Sword(); var actual = b.AddItem(s); Assert.AreEqual(AddItemStatus.ItemWrongType, actual); HealthPotion hp = new HealthPotion(); actual = b.AddItem(hp); Assert.AreEqual(AddItemStatus.Ok, actual); }
public void CannotAddNonPoitionsToPotionSatchel() { PotionSatchel container = new PotionSatchel(); GreatAxe wrongItemType = new GreatAxe(); AddItemStatus result = container.AddItem(wrongItemType); Assert.AreEqual(result, AddItemStatus.ItemWrongType); }