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

            //act
            int result = mrs.GetNumberOfRates(movie, rate);

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

            var result = mrs.GetNumberOfRates(movie, rate);

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

            MovieRatingsService mrs = new MovieRatingsService(repoMock.Object);

            //act
            int result = mrs.GetNumberOfRates(movie, rate);

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