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