Ejemplo n.º 1
0
        public void HighScoresTest()
        {
            File.Copy("HighScores.testfile", "HighScores.txt", true);
            HighScores scores = new HighScores();

            Tuple <int, string>[] values = scores.LoadScores();
            for (int i = 1; i < values.Length; i++)
            {
                Assert.IsTrue(values[i - 1].Item1 >= values[i].Item1);
            }
            scores.EnterHighScore(150, "");
            scores.EnterHighScore(350, "1337 h4x0r");
            scores.EnterHighScore(150, "");
            values = scores.LoadScores();
            for (int i = 1; i < values.Length; i++)
            {
                Assert.IsTrue(values[i - 1].Item1 >= values[i].Item1);
            }
        }