Ejemplo n.º 1
0
        public string FullDescription()
        {
            string InventoryDescription = "In " + this.Name + "You are Carrying: \n";

            foreach (string Item in _inventory.ItemList())
            {
                InventoryDescription = InventoryDescription + Item;
            }
            return(InventoryDescription);
        }
Ejemplo n.º 2
0
        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"));
        }
Ejemplo n.º 3
0
        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"));
        }