Esempio n. 1
0
        public void GetReviewsFromReviewerWithCorrectValues(int reviewerId, int count)
        {
            FakeMovieRatingRepo fakeRepo = new FakeMovieRatingRepo();

            fakeRepo.AddRating(new Rating()
            {
                ReviewerId = 2, MovieId = 1, Grade = 5, Date = DateTime.Now
            });
            fakeRepo.AddRating(new Rating()
            {
                ReviewerId = 3, MovieId = 2, Grade = 5, Date = DateTime.Now
            });
            fakeRepo.AddRating(new Rating()
            {
                ReviewerId = 3, MovieId = 2, Grade = 5, Date = DateTime.Now
            });
            IMovieRatingService service = new MovieRatingService(fakeRepo);

            int actual = service.GetReviewsByReviewer(reviewerId);

            Assert.Equal(count, actual);
        }