예제 #1
0
        public void TestRankingConversion_NotRanked()
        {
            var rawRanking = new Rank
            {
                Type = "family",
                Id = 5497,
                Name = "strategygames",
                FriendlyName = "Strategy Game Rank",
                value = "Not Ranked",
                BayesAverage = "Not Ranked"
            };

            var ranking = new Ranking(rawRanking);

            Assert.IsNull(ranking.Position);
            Assert.IsNull(ranking.BayesianAverageRating);
        }
예제 #2
0
        public void TestRankingConversion()
        {
            var rawRanking = new Rank
            {
                Type = "family",
                Id = 5497,
                Name = "strategygames",
                FriendlyName = "Strategy Game Rank",
                value = "15",
                BayesAverage = "7.77473"
            };

            var ranking = new Ranking(rawRanking);

            Assert.AreEqual("family", ranking.Type);
            Assert.AreEqual(5497, ranking.IdWithinType);
            Assert.AreEqual("strategygames", ranking.Name);
            Assert.AreEqual("Strategy Game Rank", ranking.FriendlyName);
            Assert.AreEqual(15, ranking.Position);
            Assert.AreEqual(7.77473f, ranking.BayesianAverageRating);
        }