Exemplo n.º 1
0
        public void ShouldNotAddPlayerIfPlayerWithSuchNameAlreadyExists()
        {
            HashSet <Player> players = new HashSet <Player>();

            PlayersDisplayController controller = new PlayersDisplayController(players);

            string name = "Player";

            controller.AddPlayer(name, "10");
            controller.AddPlayer(name, "20");

            Assert.AreEqual(1, players.Count);
        }
Exemplo n.º 2
0
        public void ShouldNotAddPlayerIfMoneyIsBelowMinimumBet()
        {
            HashSet <Player> players = new HashSet <Player>();

            PlayersDisplayController controller = new PlayersDisplayController(players);

            controller.AddPlayer("Player", (Bet.MINIMUM_BET - 0.1m).ToString());

            Assert.AreEqual(0, players.Count);
        }
Exemplo n.º 3
0
        public void ShouldAddPlayerIfMoneyContainsComma()
        {
            HashSet <Player> players = new HashSet <Player>();

            PlayersDisplayController controller = new PlayersDisplayController(players);

            controller.AddPlayer("Player", "10,23");

            Assert.AreEqual(1, players.Count);
        }
Exemplo n.º 4
0
        public void ShouldNotAddPlayerIfMoneyIsStringOfLetters()
        {
            HashSet <Player> players = new HashSet <Player>();

            PlayersDisplayController controller = new PlayersDisplayController(players);

            controller.AddPlayer("Player", "sadfds");

            Assert.AreEqual(0, players.Count);
        }