コード例 #1
0
        public void GetCommonDuelsGivesGivesEmptyWhenNoCommonDuels()
        {
            var api = new GameStatsApi(storage);
            var duels = api.GetCommonDuels(3, 4);

            Assert.Equal(new Duel[] {}, duels);
        }
コード例 #2
0
        public void GetClassRatingReturnsCorrectValues()
        {
            var api = new GameStatsApi(storage);

            Assert.Equal(30, api.GetClassRating("Barbarian"));
            Assert.Equal(31, api.GetClassRating("Rogue"));
            Assert.Equal(31, api.GetClassRating("Wizard"));
            Assert.Equal(0, api.GetClassRating("Knight"));
        }
コード例 #3
0
        public void GetClassPopularityReturnsCorrectValues()
        {
            var api = new GameStatsApi(storage);
            var classPop = api.GetCharacterClassPopularity();

            Assert.Equal(Percent(3, 14), classPop["Rogue"]);
            Assert.Equal(Percent(3, 14), classPop["Knight"]);
            Assert.Equal(Percent(5, 14), classPop["Wizard"]);
            Assert.Equal(Percent(3, 14), classPop["Barbarian"]);
        }
コード例 #4
0
        public void GetAllUsersVictoriesReturnsCorrectValues()
        {
            var api = new GameStatsApi(storage);
            var usersVictories = api.GetVictoryCountPerUser();

            Assert.Equal(2, usersVictories[storage.Users[0]]);
            Assert.Equal(1, usersVictories[storage.Users[1]]);
            Assert.Equal(2, usersVictories[storage.Users[2]]);
            Assert.Equal(1, usersVictories[storage.Users[3]]);
            Assert.Equal(0, usersVictories[storage.Users[4]]);
        }
コード例 #5
0
        public void GetFriendsOnlineGivesEmptyWhenNoFriends()
        {
            var api = new GameStatsApi(storage);
            var friends = api.GetFriendsOnline(1);

            Assert.Equal(new List<User>(), friends);
        }
コード例 #6
0
        public void GetCommonDuelsGivesListOfDuels()
        {
            var api = new GameStatsApi(storage);
            var duels = api.GetCommonDuels(0, 1);

            Assert.Equal(new [] {storage.Duels[0], storage.Duels[1]}, duels);
        }
コード例 #7
0
        public void GetFriendsOnlineGivesListOfContacts()
        {
            var api = new GameStatsApi(storage);
            var friends = api.GetFriendsOnline(0);

            Assert.Equal(storage.Users[0].Friends, friends);
        }