コード例 #1
0
        public void GetTopReviewers_ValidArguments()
        {
            MovieReviewRepository movieRatingRepository = new MovieReviewRepository();

            movieRatingRepository.AddJSON(movieRatingList);
            IMovieRatingService movieRatingService = new MovieRatingService(movieRatingRepository);

            Assert.True(Time(() => movieRatingService.getTopReviewers()) < 4);
        }
コード例 #2
0
        public void GetTopReviewers_ValidArguments()
        {
            MovieReviewRepository movieRatingRepository = new MovieReviewRepository();

            movieRatingRepository.Add(new MovieRatings(1, 6, 5, DateTime.Now));
            movieRatingRepository.Add(new MovieRatings(1, 6, 5, DateTime.Now));
            movieRatingRepository.Add(new MovieRatings(1, 5, 4, DateTime.Now));
            movieRatingRepository.Add(new MovieRatings(2, 4, 3, DateTime.Now));
            movieRatingRepository.Add(new MovieRatings(2, 3, 2, DateTime.Now));
            movieRatingRepository.Add(new MovieRatings(3, 2, 1, DateTime.Now));
            IMovieRatingService movieRatingService = new MovieRatingService(movieRatingRepository);

            List <int> expected = new List <int>()
            {
                1, 2, 3
            };
            List <int> actual = movieRatingService.getTopReviewers();

            Assert.Equal(expected, actual);
        }