Пример #1
0
        public void Weight_Average_For_Reviews()
        {
            int[] ratings = new int[] { 4, 10 };
            var data = BuildSellerForReview(ratings);

            var rater = new RaterServices(data);
            var result = rater.ComputeRate(new WeightedRating(), 2);

            Assert.AreEqual(6, result.Rating);
        }
Пример #2
0
        public void Simple_Average_For_Reviews()
        {
            int[] ratings = new int[] { 2, 3, 3 , 4};
            var data = BuildSellerForReview(ratings);

            var rater = new RaterServices(data);
            var result = rater.ComputeRate(new SimpleRating(), 4);

            Assert.AreEqual(3, result.Rating);
        }