public void TestAddResultInLadderTwoRecords()
        {
            ladder.RestartLadder();
            ladder = ScoreLadder.Instance;
            var movesCount = 1;
            var playerName = "toni";

            ladder.AddResultInLadder(movesCount, playerName);
            ladder.AddResultInLadder(movesCount, playerName);

            Assert.AreEqual(2, ladder.CurrentCount());
        }
 /// <summary>
 /// Initialize Singleton instanfe to null.
 /// </summary>
 public void RestartLadder()
 {
     instance = null;
 }
        public void TestReturnLadderNotEmptyList()
        {
            ladder.RestartLadder();
            ladder = ScoreLadder.Instance;
            var playerName = "toni";
            StringBuilder expectedResult = new StringBuilder();

            for (int i = 1; i <= 2; i++)
            {
                ladder.AddResultInLadder(i, playerName);
            }

            var result = ladder.ProvideContent();
            expectedResult.AppendLine("1. toni --> 1 moves");
            expectedResult.AppendLine("2. toni --> 2 moves");

            Assert.AreEqual(expectedResult.ToString(), result);
        }
 public void Initialize()
 {
     ladder = ScoreLadder.Instance;
 }
예제 #5
0
 /// <summary>
 /// Initialize Singleton instanfe to null.
 /// </summary>
 public void RestartLadder()
 {
     instance = null;
 }