public void TestPlayerIsIdentifiable() { bool actual = p.AreYou("me"); Assert.IsTrue(actual, "Player is identifiable through me"); bool actual2 = p.AreYou("inventory"); Assert.IsTrue(actual2, "Player is identifiable through inventory"); }
public void IdentifyPlayerTest() { Player TestPlayer = new Player ("TestPlayer", "For testing"); //Assert.IsTrue (TestPlayer.Locate ("TestPlayer")== TestPlayer); Assert.IsTrue (TestPlayer.AreYou ("me")); }
public void IdentifyPlayerTest() { Player TestPlayer = new Player("TestPlayer", "For testing"); //Assert.IsTrue (TestPlayer.Locate ("TestPlayer")== TestPlayer); Assert.IsTrue(TestPlayer.AreYou("me")); }
[Test] // AREYOU: The Player responds correctly to "Are You" request public void TestAreYou() { Player testPlayer = new Player("Fred", "The Mighty Programmer"); bool actual = testPlayer.AreYou("me"); bool expected = true; Assert.AreEqual(expected, actual, "AreYou() is not identifying default identifier correctly."); }
public IHaveInventory FetchContainer(Player p, string containerId) { if (p.AreYou(containerId)) { return(p); } return(p.Locate(containerId) as IHaveInventory); }
public string LookAtIn(Player p, string thingId, string containerId) { if (p.AreYou(thingId)) { return(p.LongDesc); } GameObject wantedItem = null; IHaveInventory wantedInventory = p.Locate(containerId) as IHaveInventory; if (p.AreYou(containerId) || containerId == "") { wantedInventory = (IHaveInventory)p; //return p.LongDesc; } if (wantedInventory == null) { return("i cannot find the " + containerId); } wantedItem = wantedInventory.Locate(thingId); if (wantedItem == null) { if (containerId == "") { return("i cannot find the " + thingId); } else { return("i cannot find the " + thingId + " in " + containerId); } } return(wantedItem.LongDesc); }
public string LookAtIn(Player p, string thingId, string containerId) { if (p.AreYou(thingId)) { return p.LongDesc; } GameObject wantedItem = null; IHaveInventory wantedInventory = p.Locate(containerId) as IHaveInventory; if (p.AreYou (containerId) || containerId == "") { wantedInventory = (IHaveInventory)p; //return p.LongDesc; } if (wantedInventory == null) { return "i cannot find the " + containerId; } wantedItem = wantedInventory.Locate (thingId); if (wantedItem == null) { if (containerId == "") { return "i cannot find the " + thingId; } else { return "i cannot find the " + thingId + " in " + containerId; } } return wantedItem.LongDesc; }
public void TestPlayerisIdentifiable() { Player plr = new Player("me", "cool guy"); Assert.IsTrue(plr.AreYou("me"), "should be true"); }
public void TestIdentifiable() { Player test = new Player ("Player 1", "a funny wizard"); Assert.IsTrue (test.AreYou("me")); Assert.IsTrue (test.AreYou("inventory")); }
public void TestPlayerIdentifiable() { Assert.IsTrue(_player1.AreYou("me")); Assert.IsTrue(_player1.AreYou("inventory")); }