private static void Add12345ToTopScoreList(TopScore topScore) { for (int i = 1; i <= 5; i++) { Player player = new Player(); player.Score = i; topScore.AddToTopScoreList(player); } }
public void IsTopScore_ValidInput_Test() { TopScore.Instance.Clear(); TopScore newTopScore = new TopScore(); Add12345ToTopScoreList(newTopScore); Player testPlayer = new Player(); testPlayer.Score = 0; bool result = newTopScore.IsTopScore(testPlayer); Assert.IsTrue(result); }
/// <summary> /// Initializes a new instance of Class and set new instance of class to private field. /// To make class testable. /// </summary> static TopScore() { instance = new TopScore(); }