public void GetNumberOfReviewsFromReviewer(int reviewer, int expected) { // arrange MovieRatingsService mrs = new MovieRatingsService(Repo); // act int result = mrs.GetNumberOfReviewsFromReviewer(reviewer); // assert Assert.AreEqual(expected, result); }
public void GetNumberOfReviewsFromReviewer(int movie, int expected) { ratings = new MovieRating[] { new MovieRating(2, 1, 3, DateTime.Now), new MovieRating(3, 1, 3, DateTime.Now), new MovieRating(3, 2, 4, DateTime.Now) }; MovieRatingsService mrs = new MovieRatingsService(repoMock.Object); var result = mrs.GetNumberOfReviewsFromReviewer(movie); Assert.Equal(expected, result); repoMock.Verify(repo => repo.GetAllMovieRatings(), Times.Once); }
public void GetNumberOfReviewsFromReviewer(int reviewer, int expected) { // arrange ratings = new List <MovieRating>() { new MovieRating(2, 1, 3, DateTime.Now), new MovieRating(3, 1, 4, DateTime.Now), new MovieRating(3, 2, 3, DateTime.Now), new MovieRating(4, 1, 4, DateTime.Now) }; MovieRatingsService mrs = new MovieRatingsService(repoMock.Object); // act int result = mrs.GetNumberOfReviewsFromReviewer(reviewer); // assert Assert.Equal(expected, result); repoMock.Verify(repo => repo.GetAllMovieRatings(), Times.Once); }