CanAddPlayer() public méthode

Checks if a player can be added to a HighscoreTable.
public CanAddPlayer ( int movesCount ) : bool
movesCount int The amount of moves a player has.
Résultat bool
        public void HighscoreTableShouldAddPlayerWhenNotReachedMaxPlayers()
        {
            List<PlayerScore> playerScores = new List<PlayerScore>();
            for (int i = 0; i < HighscoreTable.MaxPlayers - 1; i++)
            {
                playerScores.Add(new PlayerScore(i.ToString(), i, DateTime.Now));
            }

            HighscoreTable table = new HighscoreTable(playerScores);

            bool canAddPlayer = table.CanAddPlayer(10);

            Assert.IsTrue(canAddPlayer);
        }
        public void HighscoreTableShouldAddPlayerWhenHisScoreIsLowerThanOthers()
        {
            List<PlayerScore> playerScores = new List<PlayerScore>();
            for (int i = 0; i < HighscoreTable.MaxPlayers; i++)
            {
                playerScores.Add(new PlayerScore(i.ToString(), i + 1, DateTime.Now));
            }

            HighscoreTable table = new HighscoreTable(playerScores);

            bool canAddPlayer = table.CanAddPlayer(0);

            Assert.IsTrue(canAddPlayer);
        }