Esempio n. 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);
     }
 }
Esempio n. 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);
        }
Esempio n. 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();
 }
Esempio n. 4
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();
 }
Esempio n. 5
0
 /// <summary>
 /// Print top score list to the console
 /// </summary>
 public void PrintScoreList()
 {
     Console.WriteLine(TopScore.Renderer());
 }