コード例 #1
0
ファイル: TestBag.cs プロジェクト: queeniesowl/SwinMagic
 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);
 }
コード例 #2
0
ファイル: BagTest.cs プロジェクト: parthM9/SwinAdventure
        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);
        }
コード例 #3
0
ファイル: BagTest.cs プロジェクト: lancelotx999/SwinAdventure
        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);
        }
コード例 #4
0
        [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.");
        }
コード例 #5
0
ファイル: BagTest.cs プロジェクト: parthM9/SwinAdventure
        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);
        }
コード例 #6
0
ファイル: BagTest.cs プロジェクト: lancelotx999/SwinAdventure
        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);
        }
コード例 #7
0
        [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.");
        }
コード例 #8
0
        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");
        }
コード例 #9
0
        [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.");
        }
コード例 #10
0
ファイル: BagTest.cs プロジェクト: parthM9/SwinAdventure
        public void LocateNullTest()
        {
            Bag TestBag = new Bag(new string[] { "Test", "Bag" }, "Test Bag", "A Testing Bag");

            Assert.IsTrue(TestBag.Locate("testfail") == null);
        }
コード例 #11
0
ファイル: BagTest.cs プロジェクト: parthM9/SwinAdventure
        public void LocateSelfTest()
        {
            Bag TestBag = new Bag(new string[] { "Test", "Bag" }, "Test Bag", "A Testing Bag");

            Assert.IsTrue(TestBag.Locate("test") == TestBag);
        }
コード例 #12
0
ファイル: TestBag.cs プロジェクト: illonion/SwinAdventure
 public void TestBagLocateItself()
 {
     Assert.AreEqual(_b1, _b1.Locate("lbag"));
     Assert.AreEqual(_b1, _b1.Locate("lpouch"));
 }
コード例 #13
0
ファイル: BagTest.cs プロジェクト: lancelotx999/SwinAdventure
        public void LocateNullTest()
        {
            Bag TestBag = new Bag (new string[] { "Test", "Bag" }, "Test Bag", "A Testing Bag");

            Assert.IsTrue (TestBag.Locate ("testfail") == null);
        }
コード例 #14
0
ファイル: TestBag.cs プロジェクト: queeniesowl/SwinMagic
 public void TestBagLocateNothing()
 {
     Bag test = new Bag (new string[]{"Bag", "Backpack"}, "a bag", "This is a bag for....");
     Assert.AreEqual(test.Locate ("Sth"),null);
 }
コード例 #15
0
ファイル: TestBag.cs プロジェクト: queeniesowl/SwinMagic
 public void TestBagLocateItself()
 {
     Bag test = new Bag (new string[]{"Bag", "Backpack"}, "a bag", "This is a bag for....");
     Assert.AreEqual(test.Locate ("Bag"),test);
 }
コード例 #16
0
        public void TestBagLocatesNothing()
        {
            Bag plr = new Bag(new string[] { "bag", "container" }, "Bag", "holds stuff");

            Assert.IsNull(plr.Locate("obj1"), "should be null");
        }
コード例 #17
0
        public void TestBagLocatesItself()
        {
            Bag plr = new Bag(new string[] { "bag", "container" }, "Bag", "holds stuff");

            Assert.AreEqual(plr.Locate("bag"), plr, "should be equal");
        }
コード例 #18
0
ファイル: BagTest.cs プロジェクト: lancelotx999/SwinAdventure
        public void LocateSelfTest()
        {
            Bag TestBag = new Bag (new string[] { "Test", "Bag" }, "Test Bag", "A Testing Bag");

            Assert.IsTrue (TestBag.Locate ("test") == TestBag);
        }