public async Task EstateManagementRepository_GetContract_ContractNotFound_ErrorThrown(TestDatabaseType testDatabaseType)
        {
            EstateReportingContext context = await EstateManagementRepositoryTests.GetContext(Guid.NewGuid().ToString("N"), testDatabaseType);

            var dbContextFactory = this.GetMockDbContextFactory();
            Mock <IModelFactory> modelFactory = new Mock <IModelFactory>();

            dbContextFactory.Setup(d => d.GetContext(It.IsAny <Guid>(), It.IsAny <CancellationToken>())).ReturnsAsync(context);
            modelFactory.Setup(m => m.ConvertFrom(It.IsAny <Contract>(), It.IsAny <List <ContractProduct> >(), It.IsAny <List <ContractProductTransactionFee> >()))
            .Returns(TestData.ContractModel);
            EstateManagementRepository estateManagementRepository = new EstateManagementRepository(dbContextFactory.Object, modelFactory.Object);

            Should.Throw <NotFoundException>(async() =>
            {
                await estateManagementRepository.GetContract(TestData.EstateId,
                                                             TestData.ContractId,
                                                             false,
                                                             false,
                                                             CancellationToken.None);
            });
        }
        public async Task EstateManagementRepository_GetContract_IncludeProductsWithFees_ContractRetrieved(TestDatabaseType testDatabaseType)
        {
            EstateReportingContext context = await EstateManagementRepositoryTests.GetContext(Guid.NewGuid().ToString("N"), testDatabaseType);

            context.Contracts.Add(TestData.ContractEntity);
            context.ContractProducts.Add(TestData.ContractProductEntity);
            context.ContractProductTransactionFees.Add(TestData.ContractProductTransactionFeeEntity);
            await context.SaveChangesAsync();

            var dbContextFactory = this.GetMockDbContextFactory();
            Mock <IModelFactory> modelFactory = new Mock <IModelFactory>();

            dbContextFactory.Setup(d => d.GetContext(It.IsAny <Guid>(), It.IsAny <CancellationToken>())).ReturnsAsync(context);
            modelFactory.Setup(m => m.ConvertFrom(It.IsAny <Contract>(), It.IsAny <List <ContractProduct> >(), It.IsAny <List <ContractProductTransactionFee> >()))
            .Returns(TestData.ContractModel);
            EstateManagementRepository estateManagementRepository = new EstateManagementRepository(dbContextFactory.Object, modelFactory.Object);

            Models.Contract.Contract contractModel =
                await estateManagementRepository.GetContract(TestData.EstateId, TestData.ContractId, false, true, CancellationToken.None);

            contractModel.ShouldNotBeNull();
        }