Exemple #1
0
 private static void Add12345ToTopScoreList(TopScore topScore)
 {
     for (int i = 1; i <= 5; i++)
     {
         Player player = new Player();
         player.Score = i;
         topScore.AddToTopScoreList(player);
     }
 }
Exemple #2
0
        public void IsTopScore_InValidInput_Test()
        {
            TopScore.Instance.Clear();
            TopScore newTopScore = new TopScore();
            Add12345ToTopScoreList(newTopScore);

            Player testPlayer = new Player();
            testPlayer.Score = 9;
            bool result = newTopScore.IsTopScore(testPlayer);
            Assert.IsFalse(result);
        }
Exemple #3
0
 /// <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();
 }
 /// <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();
 }
 /// <summary>
 /// Print top score list to the console
 /// </summary>
 public void PrintScoreList()
 {
     Console.WriteLine(TopScore.Renderer());
 }