示例#1
0
        public void TestScoreSaveFormat()
        {
            LeaderboardForm board = new LeaderboardForm();

            if (File.Exists("Leaderboard.txt"))
            {
                File.Delete("Leaderboard.txt");
            }

            try
            {
                board.EcrireScores();
            }
            catch (Exception e)
            {
                Assert.Fail(e.Message);
            }
        }
示例#2
0
        public void TestScoreSaveFormat()
        {
            LeaderboardForm board = new LeaderboardForm();

            board.PlayerName  = "René";
            board.ScoreTester = 999;
            board.SortScores();
            board.ScoreTester = 998;
            board.SortScores();
            board.ScoreTester = 997;
            board.SortScores();
            board.ScoreTester = 996;
            board.SortScores();
            board.PlayerName  = "Descartes";
            board.ScoreTester = 995;
            board.SortScores();
            board.ScoreTester = 994;
            board.SortScores();
            board.ScoreTester = 993;
            board.SortScores();
            board.ScoreTester = 992;
            board.SortScores();
            board.ScoreTester = 991;
            board.SortScores();
            board.ScoreTester = 990;
            board.SortScores();
            board.EcrireScores();

            Assert.AreEqual("999,René;\n" +
                            "998,René;\n" +
                            "997,René;\n" +
                            "996,René;\n" +
                            "995,Descartes;\n" +
                            "994,Descartes;\n" +
                            "993,Descartes;\n" +
                            "992,Descartes;\n" +
                            "991,Descartes;\n" +
                            "990,Descartes;\n", File.ReadAllText("Leaderboard.txt"));
        }