public void GetCountOfGradesGivenByReviewer_ValidArguments() { MovieReviewRepository movieRatingRepository = new MovieReviewRepository(); movieRatingRepository.AddJSON(movieRatingList); IMovieRatingService movieRatingService = new MovieRatingService(movieRatingRepository); Assert.True(Time(() => movieRatingService.getCountOfGradesGivenByReviewer(1, 2)) < 4); }
public void GetCountOfGradesGivenByReviewer_ValidArguments(int reviewer, int grade, int count) { MovieReviewRepository movieRatingRepository = new MovieReviewRepository(); movieRatingRepository.Add(new MovieRatings(3, 3, grade, DateTime.Now)); movieRatingRepository.Add(new MovieRatings(3, 4, grade, DateTime.Now)); movieRatingRepository.Add(new MovieRatings(2, 1, grade, DateTime.Now)); movieRatingRepository.Add(new MovieRatings(2, 2, grade, DateTime.Now)); movieRatingRepository.Add(new MovieRatings(2, 3, grade, DateTime.Now)); IMovieRatingService movieRatingService = new MovieRatingService(movieRatingRepository); int actual = movieRatingService.getCountOfGradesGivenByReviewer(reviewer, grade); Assert.Equal(count, actual); }