示例#1
0
        public void TestNoItemFound()
        {
            inventory = new Inventory();
            bool actual = inventory.HasItem(AncientCoin.FirstId);

            Assert.IsFalse(actual, "Test for when inventory does not contain item");
        }
示例#2
0
        public void TestTakeItem()
        {
            inventory = new Inventory();
            inventory.Put(AncientCoin);
            inventory.Take(AncientCoin.FirstId);

            Assert.IsFalse(inventory.HasItem(AncientCoin.FirstId), "Returns the item, no longer in inventory");
        }
示例#3
0
        public void TestFindItem()
        {
            inventory = new Inventory();
            inventory.Put(AncientCoin);
            bool actual = inventory.HasItem(AncientCoin.FirstId);

            Assert.IsTrue(actual, "Test to find item");
        }
示例#4
0
文件: Player.cs 项目: bfog/project
 public GameObject Locate(string id)
 {
     if (AreYou(id))
     {
         return(this);
     }
     else if (_inventory.HasItem(id))
     {
         return(_inventory.Fetch(id));
     }
     else
     {
         return(_location.Locate(id));
     }
 }
示例#5
0
 public void FindItem()
 {
     Assert.IsTrue(newInventory.HasItem("shovel"));
 }