public void TestFactoryPrototypeComponentIsNotNull() { Potion prototype = new Potion("TestPotion", 99, 1); prototype.AddComponent(new ConsumableComponent(RPGStatsComponent.StatsEffect.ManaModifier, 15)); potionFactory.AddOrUpdatePrototype(PotionFactory.PotionType.Mana, prototype); Potion newPotion = potionFactory.CreateManaPotion(); Assert.IsNotNull(newPotion.GetComponent <ConsumableComponent>()); }
public void TestFactoryCreatesPrototypeItemCorrectly() { Potion prototype = new Potion("TestPotion", 99, 1); prototype.AddComponent(new ConsumableComponent(RPGStatsComponent.StatsEffect.ManaModifier, 15)); potionFactory.AddOrUpdatePrototype(PotionFactory.PotionType.Mana, prototype); Potion newPotion = potionFactory.CreateManaPotion(); Assert.AreEqual(prototype.Name, newPotion.Name); Assert.AreEqual(prototype.Cost, newPotion.Cost); Assert.AreEqual(prototype.GetComponent <ConsumableComponent>().Effect, newPotion.GetComponent <ConsumableComponent>().Effect); Assert.AreEqual(prototype.GetComponent <ConsumableComponent>().Potency, newPotion.GetComponent <ConsumableComponent>().Potency); }