public void TestFetchItem() { Inv.Put(Itm); Item fetchedItm = Inv.Fetch(Itm.FirstID); Assert.AreEqual(fetchedItm, Itm); }
public GameObject Locate(string id) { GameObject objectmain = null; objectmain = _inventory.Fetch(id); return(objectmain); }
public void TestFetchItem() { Inventory test = new Inventory (); Item item1 = new Item( new String[] {"shovel", "spade" }, "a shovel", "This is a might fine ..." ); test.Put(item1); Assert.AreEqual (test.Fetch ("shovel"), item1); }
public GameObject Locate(string id) { if (AreYou(id)) { return(this); } return(_inventory.Fetch(id)); }
public void TestTakeItem() { Inventory inv = new Inventory(new string[] { "me", "inventory" }, "Player", "Self"); inv.Put(new Item(new string[] { "obj1", "tool1" }, "axe", "normally used to cut wood")); inv.Take("obj1"); Item itm = new Item(new string[] { "obj1", "tool1" }, "axe", "normally used to cut wood"); Assert.AreNotEqual(inv.Fetch("obj1"), itm, "should be not equal"); }
public void TestFetchItem() { Inventory inv = new Inventory(new string[] { "me", "inventory" }, "Player", "Self"); Item itm = new Item(new string[] { "obj1", "tool1" }, "axe", "normally used to cut wood"); inv.Put(itm); Item test = inv.Fetch("obj1"); Assert.AreEqual(itm, test, "should be same"); }
public GameObject Locate(string id) { if (this.AreYou(id)) { return(this); } else if (_inventory.HasItem(id)) { return(_inventory.Fetch(id)); } return(Location.Locate(id)); }
[Test] // FETCH: Returns items it has, and the item remains in the inventory public void TestFetchItem() { Inventory testInventoryObject = new Inventory(); Item testItem = new Item(new string[] { "a TestFirstId", "TestSecondId" }, "TestName", "TestDesc"); testInventoryObject.Put(testItem); Item fetchedItem = testInventoryObject.Fetch("a testfirstid"); bool actual = testInventoryObject.HasItem("a testfirstid"); bool expected = true; Assert.AreEqual(expected, actual, "Item has been fetched and no longer exists in inventory."); }
public GameObject Locate(string id) { GameObject output = null; switch (id) { case "me": case "inventory": output = this; break; default: output = _inventory.Fetch(id); break; } if (output == null && _currentLocation != null) { output = _currentLocation.LocationInventory.Fetch(id); } return(output); }
public void TestNoItemFind() { Assert.AreEqual(_inventory.Fetch("card"), null); }