public void TestStick() { Troll Mateo = new Troll("Nombre1"); Stick Palo = new Stick(); IItem Variable = null; foreach (IItem Elemento in Mateo.Items) { if (Elemento.GetType() == Palo.GetType()) { Variable = Elemento; } } Assert.AreEqual(Palo.GetType(), Variable.GetType()); }
public void Troll1() { List <IItem> items = new List <IItem>(); Troll troll = new Troll("trol"); Armor armor = new Armor(); Stick stick = new Stick(); items.Add(armor); items.Add(stick); Assert.AreEqual(armor.GetType(), troll.Items[1].GetType()); Assert.AreEqual(stick.GetType(), troll.Items[0].GetType()); }