public AddPlayer ( PlayerScore score ) : void | ||
score | PlayerScore | An instance of a class that implements the PlayerScore interface. |
리턴 | void |
public void AddingPlayerToHighscoreTableShouldWorkCorrectly() { HighscoreTable table = new HighscoreTable(); PlayerScore somePlayer = new PlayerScore("Pesho", 10, DateTime.Now); table.AddPlayer(somePlayer); Assert.AreEqual(1, table.Table.Count); }
public void HighscoreTableSizeShouldNotChangeWhenAddingMoreThanMaxPlayers() { List<PlayerScore> playerScores = new List<PlayerScore>(); for (int i = 0; i < HighscoreTable.MaxPlayers; i++) { playerScores.Add(new PlayerScore(i.ToString(), i, DateTime.Now)); } HighscoreTable table = new HighscoreTable(playerScores); PlayerScore somePlayer = new PlayerScore("Pesho", 10, DateTime.Now); table.AddPlayer(somePlayer); Assert.AreEqual(HighscoreTable.MaxPlayers, table.Table.Count); }