public void GetTopGradedMovies_ValidArguments() { MovieReviewRepository movieRatingRepository = new MovieReviewRepository(); movieRatingRepository.AddJSON(movieRatingList); IMovieRatingService movieRatingService = new MovieRatingService(movieRatingRepository); Assert.True(Time(() => movieRatingService.getIdOfTopGradedMovies()) < 4); }
public void GetTopGradedMovies_ValidArguments() { MovieReviewRepository movieRatingRepository = new MovieReviewRepository(); movieRatingRepository.Add(new MovieRatings(1, 6, 5, DateTime.Now)); movieRatingRepository.Add(new MovieRatings(2, 6, 5, DateTime.Now)); movieRatingRepository.Add(new MovieRatings(1, 4, 3, DateTime.Now)); movieRatingRepository.Add(new MovieRatings(1, 5, 4, DateTime.Now)); movieRatingRepository.Add(new MovieRatings(1, 3, 2, DateTime.Now)); movieRatingRepository.Add(new MovieRatings(1, 2, 1, DateTime.Now)); movieRatingRepository.Add(new MovieRatings(2, 2, 1, DateTime.Now)); movieRatingRepository.Add(new MovieRatings(1, 1, 1, DateTime.Now)); IMovieRatingService movieRatingService = new MovieRatingService(movieRatingRepository); List <int> expected = new List <int>() { 6, 5, 4, 3, 2, 1 }; List <int> actual = movieRatingService.getIdOfTopGradedMovies(); Assert.Equal(expected, actual); }