Example #1
0
        public void TwoPlayersTie()
        {
            Player firstPlayer = new Player()
            {
                FPPG = 1
            };

            Player secondPlayer = new Player()
            {
                FPPG = 1
            };

            List <Player> players = new List <Player> {
                firstPlayer, secondPlayer
            };
            IEnumerable <Player> HighestPlayers = GuessingGame.GetPlayerWithHighestFPPG(players);

            //everyone is a winner!
            Assert.True(HighestPlayers.Contains(firstPlayer) && HighestPlayers.Contains(secondPlayer), "One of the players was a loser");
        }
Example #2
0
        public void FirstPlayerIsLoserSecondPlayerIsWinner()
        {
            Player firstPlayer = new Player()
            {
                FPPG = 1
            };

            Player secondPlayer = new Player()
            {
                FPPG = 99
            };

            List <Player> players = new List <Player> {
                firstPlayer, secondPlayer
            };
            IEnumerable <Player> HighestPlayers = GuessingGame.GetPlayerWithHighestFPPG(players);

            Assert.True(!HighestPlayers.Contains(firstPlayer), "First player was a winner");
            Assert.True(HighestPlayers.Contains(secondPlayer), "Second player was a loser");
        }