Ejemplo n.º 1
0
        [InlineData(3, 2)]      // expected[2] = {3, 2, 1}
        public void GetTopMoviesByReviewer(int reviewer, int expectedIndex)
        {
            var expected = new List <int>[]
            {
                new List <int>(),
                new List <int>()
                {
                    1
                },
                new List <int>()
                {
                    3, 2, 1
                }
            };

            ratings = new MovieRating[]
            {
                new MovieRating(2, 1, 1, new DateTime(2020, 1, 1)),
                new MovieRating(3, 1, 3, new DateTime(2020, 1, 1)),
                new MovieRating(3, 2, 4, new DateTime(2020, 1, 2)),
                new MovieRating(3, 3, 4, new DateTime(2020, 1, 1))
            };

            IMovieRatingsService mrs = new MovieRatingsServiceLinq(repoMock.Object);

            var result = mrs.GetTopMoviesByReviewer(reviewer);

            Assert.Equal(expected[expectedIndex], result);
            repoMock.Verify(repo => repo.GetAllMovieRatings(), Times.Once);
        }
        public void GetTopMoviesByReviewer()
        {
            IMovieRatingsService mrs = new MovieRatingsServiceLinq(repository);

            double seconds = TimeInSeconds(() =>
            {
                var result = mrs.GetTopMoviesByReviewer(reviewerMostReviews);
            });

            Assert.True(seconds <= 4);
        }
Ejemplo n.º 3
0
        public void GetTopMoviesByReviewer()
        {
            IMovieRatingsService mrs = new MovieRatingsServiceLinq(repository);

            mrs.GetTopMoviesByReviewer(reviewerMostReviews);
        }
Ejemplo n.º 4
0
 public void GetTopMoviesByReviewer()
 {
     service.GetTopMoviesByReviewer(reviewerMostReviews);
 }