예제 #1
0
        public void TwoPlayersTopScoresBoardTest()
        {
            TopScoresBoard topScoresBoard = new TopScoresBoard();

            topScoresBoard.TryToSignInTopPlayerList(new Player("Ivan", 15));
            topScoresBoard.TryToSignInTopPlayerList(new Player("Gosho", 5));

            string actual = topScoresBoard.GetTopScores();
            string expected = "Scoreboard:\r\n1. Ivan --> 15 cells\r\n2. Gosho --> 5 cells";
            Assert.AreEqual(expected, actual);
        }
예제 #2
0
        public void FivePlayersTopScoresBoardTest()
        {
            TopScoresBoard topScoresBoard = new TopScoresBoard();

            topScoresBoard.TryToSignInTopPlayerList(new Player("Ivan", 15));
            topScoresBoard.TryToSignInTopPlayerList(new Player("Grigor", 25));
            topScoresBoard.TryToSignInTopPlayerList(new Player("Stefan", 25));
            topScoresBoard.TryToSignInTopPlayerList(new Player("Naiden", 10));
            topScoresBoard.TryToSignInTopPlayerList(new Player("Pesho", 0));

            string actual = topScoresBoard.GetTopScores();
            string expected = "Scoreboard:\r\n" +
                "1. Grigor --> 25 cells\r\n" +
                "2. Stefan --> 25 cells\r\n" +
                "3. Ivan --> 15 cells\r\n" +
                "4. Naiden --> 10 cells\r\n" +
                "5. Pesho --> 0 cells";
            Assert.AreEqual(expected, actual);
        }