public async Task GetFilteredBooks_UserHasOneCurrentlyReadingBook_ReturnsOneBook()
        {
            // Arrange
            var tenDaysAgo  = DateTime.Now.Subtract(new TimeSpan(10, 0, 0, 0));
            var fiveDaysAgo = DateTime.Now.Subtract(new TimeSpan(5, 0, 0, 0));
            var userOne     = new ApplicationUserBuilder().WithId("1").Build();
            var userTwo     = new ApplicationUserBuilder().WithId("2").Build();
            var data        = new List <Book>
            {
                new BookBuilder().WithUser(userOne)
                .WithReadingStart(tenDaysAgo)
                .WithReadingEnd(fiveDaysAgo)
                .Build(),
                new BookBuilder().WithUser(userOne)
                .WithReadingStart(tenDaysAgo)
                .Build(),
                new BookBuilder().WithUser(userTwo)
                .WithReadingStart(tenDaysAgo)
                .Build()
            };
            var dbset        = GenerateEnumerableDbSetMock(data.AsQueryable());
            var context      = GenerateEnumerableContextMock(dbset);
            var booksService = new BooksService(context.Object);
            var filters      = new BookFiltersBuilder()
                               .WithCurrentlyReadingStatus(true)
                               .Build();

            // Act
            var result = await booksService.GetFilteredBooks(userOne.Id, filters);

            // Assert
            result.Should().HaveCount(1);
        }
        public async Task GetFilteredBooks_UserHasTwoBooksWithYear_ReturnsTwoBooks()
        {
            // Arrange
            var userOne = new ApplicationUserBuilder().WithId("1").Build();
            var userTwo = new ApplicationUserBuilder().WithId("2").Build();
            var data    = new List <Book>
            {
                new BookBuilder().WithUser(userOne).WithYear(2015).Build(),
                new BookBuilder().WithUser(userOne).WithYear(2010).Build(),
                new BookBuilder().WithUser(userTwo).WithYear(2010).Build()
            };
            var dbset        = GenerateEnumerableDbSetMock(data.AsQueryable());
            var context      = GenerateEnumerableContextMock(dbset);
            var booksService = new BooksService(context.Object);
            var filters      = new BookFiltersBuilder()
                               .WithPublicationYearSince(2005)
                               .WithPublicationYearTo(2015)
                               .Build();

            // Act
            var result = await booksService.GetFilteredBooks(userOne.Id, filters);

            // Assert
            result.Should().HaveCount(2);
        }