public void Computes_Result_For_Two_Reviews() { int[] ratings={4,8}; var data = BuildRestaurantAndReviews(ratings); var rater = new RestaurantRater(data); var result = rater.ComputeResult(new SimpleRatingAlgorithm(), 10); Assert.AreEqual(6, result.Rating); }
public void Weighted_Averaging_For_Two_Reviews() { var data = BuildRestaurantAndReviews(3, 9); var rater = new RestaurantRater(data); var result = rater.ComputeResult(new WeightedRatingAlgorithm(), 10); Assert.AreEqual(5, result.Rating); }
public void Rating_Includes_Only_First_N_Reviews() { var data = BuildRestaurantAndReviews(1, 1, 1, 10, 10, 10); var rater = new RestaurantRater(data); var result = rater.ComputeResult(new SimpleRatingAlgorithm(), 3); Assert.AreEqual(1, result.Rating); }