public string FullDescription() { string InventoryDescription = "In " + this.Name + "You are Carrying: \n"; foreach (string Item in _inventory.ItemList()) { InventoryDescription = InventoryDescription + Item; } return(InventoryDescription); }
public void ListItemTest() { Item TestItem = new Item(new string[] { "potato", "baked" }, "baked potato", "a baked potato"); Item TestItem2 = new Item(new string[] { "chicken", "baked" }, "baked chicken", "a baked chicken"); Inventory TestInventory = new Inventory(); TestInventory.PutItem(TestItem); TestInventory.PutItem(TestItem2); //Assert.IsTrue (TestItem.ShortDesc == ("A baked potato potato.")); //ItemList.Add (Check.Name + "\t" + Check.ShortDesc + "\n"); //"baked potato" + "\t" + "A baked potato potato." + "\n" Assert.IsTrue(TestInventory.HasItem("potato")); Assert.IsTrue(TestInventory.HasItem("chicken")); Assert.IsTrue(TestInventory.ItemList().Contains("baked potato" + "\t" + "A baked potato potato." + "\n")); Assert.IsTrue(TestInventory.ItemList().Contains("baked chicken" + "\t" + "A baked chicken chicken." + "\n")); }
public void ListItemTest() { Item TestItem = new Item (new string[] { "potato", "baked" }, "baked potato", "a baked potato"); Item TestItem2 = new Item (new string[] { "chicken", "baked" }, "baked chicken", "a baked chicken"); Inventory TestInventory = new Inventory (); TestInventory.PutItem (TestItem); TestInventory.PutItem (TestItem2); //Assert.IsTrue (TestItem.ShortDesc == ("A baked potato potato.")); //ItemList.Add (Check.Name + "\t" + Check.ShortDesc + "\n"); //"baked potato" + "\t" + "A baked potato potato." + "\n" Assert.IsTrue (TestInventory.HasItem ("potato")); Assert.IsTrue (TestInventory.HasItem ("chicken")); Assert.IsTrue (TestInventory.ItemList ().Contains("baked potato" + "\t" + "A baked potato potato." + "\n")); Assert.IsTrue (TestInventory.ItemList ().Contains("baked chicken" + "\t" + "A baked chicken chicken." + "\n")); }