CanAddPlayer() публичный Метод

Checks if a player can be added to a HighscoreTable.
public CanAddPlayer ( int movesCount ) : bool
movesCount int The amount of moves a player has.
Результат bool
Пример #1
0
        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);
        }
Пример #2
0
        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);
        }