public void TestLastSquareLeave() { Square lastSquare = new LastSquare(); Player player = new Player("Dominic"); Player player2 = new Player("Lachlan"); lastSquare.Enter(player); lastSquare.Leave(player); Assert.AreEqual(lastSquare.ContainPlayers.Count, 1); //doesn't change as player has won, player can't leave Assert.IsTrue(lastSquare.ContainPlayers.Contains(player)); }
public void TestLastSquareEnter() { Square lastSquare = new LastSquare(); Player player = new Player("Dominic"); Player player2 = new Player("Lachlan"); lastSquare.Enter(player); Assert.AreEqual(lastSquare.ContainPlayers.Count, 1); lastSquare.Enter(player2); Assert.AreEqual(lastSquare.ContainPlayers.Count, 1); //doesn't change since player 1 has already won Assert.IsTrue(lastSquare.ContainPlayers.Contains(player)); lastSquare.Enter(player2); Assert.IsTrue(lastSquare.ContainPlayers.Contains(player)); //lastsquare still constains player even if player2 keep on entering }