[Test] // TAKE: Returns items it has, and the item remains in the inventory public void TestTakeItem() { Inventory testInventoryObject = new Inventory(); Item testItem = new Item(new string[] { "a TestFirstId", "TestSecondId" }, "TestName", "TestDesc"); testInventoryObject.Put(testItem); testInventoryObject.Take("a testfirstid"); Item actual = testInventoryObject.Take("a testfirstid"); Item expected = null; Assert.AreEqual(expected, actual, "Item has been taken but still remains in the inventory."); }
public void TestTakeItem() { Inv.Put(Itm); Item takenItem = Inv.Take(Itm.FirstID); bool actual = Inv.HasItem(Itm.FirstID); Assert.IsFalse(actual, "Test that item is taken"); }
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 TestTakeItem() { Assert.AreEqual(_inventory.Take("shovel"), _shovel); Assert.IsFalse(_inventory.HasItem("shovel")); }