public void GetNumberOfRatesByReviewer(int reviewer, int rate, int expected)
        {
            // arrange
            MovieRatingsService mrs = new MovieRatingsService(Repo);

            // act
            int result = mrs.GetNumberOfRatesByReviewer(reviewer, rate);

            // assert
            Assert.AreEqual(expected, result);
        }
Example #2
0
        public void GetNumberOfRatesByReviewer(int reviewer, int rate, int expected)
        {
            ratings = new MovieRating[]
            {
                new MovieRating(2, 1, 3, DateTime.Now),
                new MovieRating(2, 2, 4, DateTime.Now),
                new MovieRating(2, 3, 4, DateTime.Now)
            };
            MovieRatingsService mrs = new MovieRatingsService(repoMock.Object);

            var result = mrs.GetNumberOfRatesByReviewer(reviewer, rate);

            Assert.Equal(expected, result);
            repoMock.Verify(repo => repo.GetAllMovieRatings(), Times.Once);
        }
Example #3
0
        public void GetNumberOfRatesByReviewer(int reviewer, int rate, int expected)
        {
            // arrange
            ratings = new List <MovieRating>()
            {
                new MovieRating(1, 1, 2, DateTime.Now),
                new MovieRating(2, 1, 5, DateTime.Now),
                new MovieRating(2, 2, 5, DateTime.Now),
                new MovieRating(2, 3, 5, DateTime.Now),
                new MovieRating(3, 3, 5, DateTime.Now)
            };

            MovieRatingsService mrs = new MovieRatingsService(repoMock.Object);

            // act
            int result = mrs.GetNumberOfRatesByReviewer(reviewer, rate);

            // assert
            Assert.Equal(expected, result);
            repoMock.Verify(repo => repo.GetAllMovieRatings(), Times.Once);
        }