public void TestAvarageReviewOfMovie(int MovieID, double expected) { IRepository repo = new FakeRepository(); repo.Add(new Review(1, 2, 1, System.DateTime.Now)); repo.Add(new Review(4, 2, 3, System.DateTime.Now)); repo.Add(new Review(2, 3, 2, System.DateTime.Now)); repo.Add(new Review(2, 1, 5, System.DateTime.Now)); repo.Add(new Review(3, 2, 5, System.DateTime.Now)); ReviewService RS = new ReviewService(repo); Assert.Equal(expected, RS.AvarageReviewOfMovie(MovieID)); }
public void TestAvarageReviewOfMovie() { ReviewService RS = new ReviewService(repository); AssertPerformance(() => RS.AvarageReviewOfMovie(5), MaxExecutionDuration, ExecutionCycles); }