Exemplo n.º 1
0
        public void GetMoviesWithHighestNumberOfTopRates()
        {
            ratings = new List <MovieRating>()
            {
                new MovieRating(1, 1, 5, DateTime.Now),
                new MovieRating(1, 2, 5, DateTime.Now),

                new MovieRating(2, 1, 4, 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);

            List <int> expected = new List <int>()
            {
                2, 3
            };

            // act
            var result = mrs.GetMoviesWithHighestNumberOfTopRates();

            // assert
            Assert.Equal(expected, result);
            repoMock.Verify(repo => repo.GetAllMovieRatings(), Times.Once);
        }
        public void GetMoviesWithHighestNumberOfTopRates()
        {
            // arange
            MovieRatingsService mrs = new MovieRatingsService(Repo);

            List <int> expected = new List <int>()
            {
                1664010
            };

            // act
            var result = mrs.GetMoviesWithHighestNumberOfTopRates();

            // assert
            CollectionAssert.AreEqual(expected, result);
        }