public void TestHandleScoreboardWithOnePlayer()
 {
     TopFiveScoreboard scoreboard = new TopFiveScoreboard();
     scoreboard.HandleScoreboard(5, "gosho");
     int actual = scoreboard.Scoreboard.Count;
     Assert.AreEqual(1, actual);
 }
        public void GameMenuControlTopTest()
        {
            using (StringWriter sw = new StringWriter())
            {
                Console.SetOut(sw);

                TopFiveScoreboard scores = new TopFiveScoreboard();
                UserInterfaceSimulation userInterface = new UserInterfaceSimulation();
                userInterface.SimulateInput = "top";
                LabyrinthEngine testEngine = new LabyrinthEngine();
                testEngine.GameMenuControl();

                StringBuilder expectedStringBuilder = new StringBuilder();
                expectedStringBuilder.Append("The scoreboard is empty.");
                expectedStringBuilder.Append(Environment.NewLine);
                expectedStringBuilder.Append("\nEnter your move (L=left, R=right, U=up, D=down):");
                expectedStringBuilder.Append("Good Bye!");
                expectedStringBuilder.Append(Environment.NewLine);

                string expectedString = expectedStringBuilder.ToString();
                string output = sw.ToString();
                output = output.Substring(output.Length - 86);

                Assert.AreEqual<string>(expectedString, output);
            }
        }
        public void TestHandleScoreboardCaseWithSixthPlayerBetterThanRest()
        {
            TopFiveScoreboard scoreboard = new TopFiveScoreboard();
            scoreboard.HandleScoreboard(5, "Mustafa");
            scoreboard.HandleScoreboard(6, "Az");
            scoreboard.HandleScoreboard(2, "Asen");
            scoreboard.HandleScoreboard(1, "Pesho");
            scoreboard.HandleScoreboard(9, "gosho");
            scoreboard.HandleScoreboard(3, "maicon");

            List<Tuple<uint, string>> expectedScoreBoard = new List<Tuple<uint, string>>();
            expectedScoreBoard.Add(new Tuple<uint, string>(1, "Pesho"));
            expectedScoreBoard.Add(new Tuple<uint, string>(2, "Asen"));
            expectedScoreBoard.Add(new Tuple<uint, string>(3, "maicon"));
            expectedScoreBoard.Add(new Tuple<uint, string>(5, "Mustafa"));
            expectedScoreBoard.Add(new Tuple<uint, string>(6, "Az"));
            expectedScoreBoard.Add(new Tuple<uint, string>(9, "gosho"));
            List<Tuple<uint, string>> actual = scoreboard.Scoreboard;
            Assert.AreEqual<Tuple<uint, string>>(expectedScoreBoard[3], actual[3]);
        }
        public void TestHandleScoreboardSortingPriveteMethod()
        {
            TopFiveScoreboard scoreboard = new TopFiveScoreboard();
            scoreboard.HandleScoreboard(5, "Mustafa");
            scoreboard.HandleScoreboard(6, "Az");
            scoreboard.HandleScoreboard(2, "Asen");
            scoreboard.HandleScoreboard(1, "Pesho");
            scoreboard.HandleScoreboard(9, "gosho");

            List<Tuple<uint, string>> expectedScoreBoard = new List<Tuple<uint, string>>();
            expectedScoreBoard.Add(new Tuple<uint, string>(1, "Pesho"));
            expectedScoreBoard.Add(new Tuple<uint, string>(2, "Asen"));
            expectedScoreBoard.Add(new Tuple<uint, string>(5, "Mustafa"));
            expectedScoreBoard.Add(new Tuple<uint, string>(6, "Az"));
            expectedScoreBoard.Add(new Tuple<uint, string>(9, "gosho"));
            List<Tuple<uint, string>> actual = scoreboard.Scoreboard;
            Assert.AreEqual<Tuple<uint, string>>(expectedScoreBoard[0], actual[0]);
            Assert.AreEqual<Tuple<uint, string>>(expectedScoreBoard[1], actual[1]);
            Assert.AreEqual<Tuple<uint, string>>(expectedScoreBoard[2], actual[2]);
            Assert.AreEqual<Tuple<uint, string>>(expectedScoreBoard[3], actual[3]);
            Assert.AreEqual<Tuple<uint, string>>(expectedScoreBoard[4], actual[4]);
        }
 public void TestHandleScoreboardWithSixthPlayerWorseThanRest()
 {
     TopFiveScoreboard scoreboard = new TopFiveScoreboard();
     scoreboard.HandleScoreboard(5, "Mustafa");
     scoreboard.HandleScoreboard(6, "Az");
     scoreboard.HandleScoreboard(2, "Asen");
     scoreboard.HandleScoreboard(1, "Pesho");
     scoreboard.HandleScoreboard(9, "gosho");
     scoreboard.HandleScoreboard(10, "ronaldo");
        bool actual = scoreboard.Scoreboard.Contains(new Tuple<uint,string>(10,"ronaldo"));
        Assert.AreEqual(false, actual);
 }
 public void TestScoreBoardConstructor()
 {
     TopFiveScoreboard scoreboard = new TopFiveScoreboard();
     int actual = scoreboard.Scoreboard.Count;
     Assert.AreEqual(0, actual);
 }
 public LabyrinthEngine()
 {
     this.scoreboard = new TopFiveScoreboard();
 }