public void GetStandings_Default_ReturnsScoresInOrder()
        {
            var leaderBoard = new Leaderboard();
            var scores = new Dictionary<Character, int>();
            scores.Add(Character.Mario, 0);
            scores.Add(Character.Luigi, Constants.FirstPlacePoints);
            scores.Add(Character.Bowser, Constants.ThirdPlacePoints);

            var expectedStandings = new SortedDictionary<int, IPlayerScore>();
            expectedStandings.Add(1, new PlayerScore(Character.Luigi, Constants.FirstPlacePoints));
            expectedStandings.Add(2, new PlayerScore(Character.Bowser, Constants.ThirdPlacePoints));
            expectedStandings.Add(3, new PlayerScore(Character.Mario, 0));

            leaderBoard.CalculateStandings(scores);

            leaderBoard.Standings.ShouldBeEquivalentTo(expectedStandings);
        }
Exemple #2
0
        public void GetStandings_Default_ReturnsScoresInOrder()
        {
            var leaderBoard = new Leaderboard();
            var scores      = new Dictionary <Character, int>();

            scores.Add(Character.Mario, 0);
            scores.Add(Character.Luigi, Constants.FirstPlacePoints);
            scores.Add(Character.Bowser, Constants.ThirdPlacePoints);

            var expectedStandings = new SortedDictionary <int, IPlayerScore>();

            expectedStandings.Add(1, new PlayerScore(Character.Luigi, Constants.FirstPlacePoints));
            expectedStandings.Add(2, new PlayerScore(Character.Bowser, Constants.ThirdPlacePoints));
            expectedStandings.Add(3, new PlayerScore(Character.Mario, 0));

            leaderBoard.CalculateStandings(scores);

            leaderBoard.Standings.ShouldBeEquivalentTo(expectedStandings);
        }