Пример #1
0
    public void TestCheckScoreIsHighscoreWithZeroRecords()
    {
        ScoreBoard scoreBoard  = new ScoreBoard();
        bool       isHighscore = scoreBoard.CheckScoreIsHighscore(6);

        Assert.IsTrue(isHighscore);
    }
Пример #2
0
    public void TestCheckScoreIsHighscoreWithLessThanFiveRecordsAndCheckWorse()
    {
        ScoreBoard scoreBoard = new ScoreBoard();

        scoreBoard.AddScore("Pesho", 2);
        scoreBoard.AddScore("Pesho", 0);
        scoreBoard.AddScore("Ivan", 5);
        bool isHighscore = scoreBoard.CheckScoreIsHighscore(6);

        Assert.IsTrue(isHighscore);
    }
Пример #3
0
    public void TestCheckScoreIsHighscoreWithAllPerfectScores()
    {
        ScoreBoard scoreBoard = new ScoreBoard();

        scoreBoard.AddScore("Pesho", 0);
        scoreBoard.AddScore("Pesho", 0);
        scoreBoard.AddScore("Asya", 0);
        scoreBoard.AddScore("Gergana", 0);
        scoreBoard.AddScore("Ivan", 0);
        bool isHighscore = scoreBoard.CheckScoreIsHighscore(0);

        Assert.IsTrue(isHighscore);
    }
Пример #4
0
    public void TestCheckScoreIsHighscoreWithMoreThanFiveRecordsAndCheckWorse()
    {
        ScoreBoard scoreBoard = new ScoreBoard();

        scoreBoard.AddScore("Pesho", 2);
        scoreBoard.AddScore("Pesho", 0);
        scoreBoard.AddScore("Asya", 1);
        scoreBoard.AddScore("Gergana", 0);
        scoreBoard.AddScore("Ivan", 5);
        bool isHighscore = scoreBoard.CheckScoreIsHighscore(6);

        Assert.IsFalse(isHighscore);
    }
Пример #5
0
    public void TestCheckScoreIsHighscoreWithThreeScores()
    {
        ScoreBoard        scoreBoard = new ScoreBoard();
        List <ScoreEntry> highScores = new List <ScoreEntry>();

        highScores.Add(new ScoreEntry("Pesho", 2));
        highScores.Add(new ScoreEntry("Pesho", 0));
        highScores.Add(new ScoreEntry("Pesho", 1));

        bool result = scoreBoard.CheckScoreIsHighscore(0);

        Assert.IsTrue(result);
    }