Exemple #1
0
        public async Task AllShoulReturnCorrectResultPerPage()
        {
            var db = this.GetDatabase();

            db.Reviews.AddRange(this.reviews);
            db.Users.AddRange(this.users);
            db.SaveChanges();
            var reviewService = new ReviewsService(db, null);

            var allReviews = await reviewService.All(1, 1, 1);

            allReviews
            .Should()
            .Match(r => r.ElementAt(0).Rating == 5)
            .And
            .HaveCount(1);

            var allReviewsSecondPage = await reviewService.All(1, 2, 10);

            allReviewsSecondPage
            .Should()
            .HaveCount(0);
        }