public async Task FinishRentAsyncShouldChangeStatusToPendingAndReduceProductQuantity(int productQuantity, bool isRented, RentStatus expectedStatus, bool expextedIsRented, int expectedProductQuantity)
        {
            var options = new DbContextOptionsBuilder <PhotoparallelDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;
            var dbContext = new PhotoparallelDbContext(options);

            var rent = new Rent {
                RentStatus = RentStatus.Open
            };

            dbContext.Rents.Add(rent);

            var productService  = new Mock <IProductsService>();
            var invoicesService = new Mock <IInvoicesService>();
            var userService     = new Mock <IUsersService>();

            var product = new Product {
                Name = "Canon M50", Quantity = productQuantity, IsRented = isRented
            };

            dbContext.Products.Add(product);

            var rentProduct = new RentProduct {
                Product = product, Quantity = 1
            };

            rent.Products.Add(rentProduct);
            await dbContext.SaveChangesAsync();

            var rentsService = new RentsService(dbContext, userService.Object, invoicesService.Object, productService.Object);

            await rentsService.FinishRentAsync(rent);

            Assert.Equal(expectedStatus, rent.RentStatus);
            Assert.Equal(expextedIsRented, product.IsRented);
            Assert.Equal(expectedProductQuantity, product.Quantity);
        }