public void TestBagLocationItems() { Bag test = new Bag (new string[]{"Bag", "Backpack"}, "a bag", "This is a bag for...."); Item item1 = new Item( new String[] {"shovel", "spade" }, "a shovel", "This is a might fine ..." ); test.Inventory.Put (item1); Assert.AreEqual(test.Locate ("shovel"),item1); }
public void BagBagTest() { Bag b1 = new Bag(new string[] { "b1", "Bag" }, "Test Bag", "A Testing Bag"); Bag b2 = new Bag(new string[] { "b2", "Bag" }, "b2 Bag", "A Testing Bag"); 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"); b1.Inventory.PutItem(TestItem); b2.Inventory.PutItem(TestItem2); b1.Inventory.PutItem(b2); Assert.IsTrue(b1.Locate("potato") == TestItem); Assert.IsFalse(b1.Locate("chicken") == TestItem2); Assert.IsTrue(b1.Locate("b2") == b2); }
public void BagBagTest() { Bag b1 = new Bag (new string[] { "b1", "Bag" }, "Test Bag", "A Testing Bag"); Bag b2 = new Bag (new string[] { "b2", "Bag" }, "b2 Bag", "A Testing Bag"); 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"); b1.Inventory.PutItem (TestItem); b2.Inventory.PutItem (TestItem2); b1.Inventory.PutItem (b2); Assert.IsTrue (b1.Locate ("potato") == TestItem); Assert.IsFalse (b1.Locate ("chicken") == TestItem2); Assert.IsTrue (b1.Locate ("b2") == b2); }
[Test] // LOCATE: The Bag can locate itself public void TestLocateBagItself() { Bag testBag = new Bag(new string[] { "bag", "container" }, "a Bag", "A Container for Items"); // Locate the BAG and store in GameObject: GameObject actual = testBag.Locate("bag"); GameObject expected = testBag; Assert.AreEqual(expected, actual, "The Bag is not locating itself correctly."); }
public void LocateTest() { Bag TestBag = new Bag(new string[] { "Test", "Bag" }, "Test Bag", "A Testing Bag"); Item TestItem = new Item(new string[] { "potato", "baked" }, "baked potato", "a baked potato"); TestBag.Inventory.PutItem(TestItem); Assert.IsTrue(TestBag.Locate("potato") == TestItem); }
public void LocateTest() { Bag TestBag = new Bag (new string[] { "Test", "Bag" }, "Test Bag", "A Testing Bag"); Item TestItem = new Item (new string[] { "potato", "baked" }, "baked potato", "a baked potato"); TestBag.Inventory.PutItem (TestItem); Assert.IsTrue (TestBag.Locate ("potato") == TestItem); }
[Test] // LOCATE: Return null if located item not in Bag public void TestLocateBagReturnsNull() { Bag testBag = new Bag(new string[] { "bag", "container" }, "a Bag", "A Container for Items"); Item testItem = new Item(new string[] { "item", "A passed item" }, "an item", "This item could be anything"); // Return NULL if an Item cannot be found: GameObject actual = testBag.Locate("different item"); GameObject expected = null; Assert.AreEqual(expected, actual, "The Bag is not locating itself correctly."); }
public void TestBagLocatesItem() { B1.Inventory.Put(Itm); GameObject actual = B1.Locate(Itm.FirstID); GameObject expected = Itm; Assert.AreEqual(expected, actual, "Test bag can locate item"); }
[Test] // LOCATE: The Bag can locate items in its inventory public void TestLocateBagItems() { Bag testBag = new Bag(new string[] { "bag", "container" }, "a Bag", "A Container for Items"); Item testItem = new Item(new string[] { "item", "A passed item" }, "an item", "This item could be anything"); testBag.Inventory.Put(testItem); // Locate the item and store in GameObject: GameObject locatedItem = testBag.Locate("item"); // Search Inventory for item: bool actual = testBag.Inventory.HasItem("item"); bool expected = true; Assert.AreEqual(expected, actual, "Item in Bag's Inventory is not locating correctly."); }
public void LocateNullTest() { Bag TestBag = new Bag(new string[] { "Test", "Bag" }, "Test Bag", "A Testing Bag"); Assert.IsTrue(TestBag.Locate("testfail") == null); }
public void LocateSelfTest() { Bag TestBag = new Bag(new string[] { "Test", "Bag" }, "Test Bag", "A Testing Bag"); Assert.IsTrue(TestBag.Locate("test") == TestBag); }
public void TestBagLocateItself() { Assert.AreEqual(_b1, _b1.Locate("lbag")); Assert.AreEqual(_b1, _b1.Locate("lpouch")); }
public void LocateNullTest() { Bag TestBag = new Bag (new string[] { "Test", "Bag" }, "Test Bag", "A Testing Bag"); Assert.IsTrue (TestBag.Locate ("testfail") == null); }
public void TestBagLocateNothing() { Bag test = new Bag (new string[]{"Bag", "Backpack"}, "a bag", "This is a bag for...."); Assert.AreEqual(test.Locate ("Sth"),null); }
public void TestBagLocateItself() { Bag test = new Bag (new string[]{"Bag", "Backpack"}, "a bag", "This is a bag for...."); Assert.AreEqual(test.Locate ("Bag"),test); }
public void TestBagLocatesNothing() { Bag plr = new Bag(new string[] { "bag", "container" }, "Bag", "holds stuff"); Assert.IsNull(plr.Locate("obj1"), "should be null"); }
public void TestBagLocatesItself() { Bag plr = new Bag(new string[] { "bag", "container" }, "Bag", "holds stuff"); Assert.AreEqual(plr.Locate("bag"), plr, "should be equal"); }
public void LocateSelfTest() { Bag TestBag = new Bag (new string[] { "Test", "Bag" }, "Test Bag", "A Testing Bag"); Assert.IsTrue (TestBag.Locate ("test") == TestBag); }