public When_MatchingServiceOpportunityReport_Is_Called_For_Pipeline_Opportunity() { _dbContext = new TestConfiguration().GetDbContext(); _opportunityBuilder = new OpportunityBuilder(_dbContext); _providerBuilder = new ProviderBuilder(_dbContext); _employerBuilder = new EmployerBuilder(_dbContext); _postcodeLookupBuilder = new PostcodeLookupBuilder(_dbContext); _localEnterprisePartnershipBuilder = new LocalEnterprisePartnershipBuilder(_dbContext); ClearData(); var employer = _employerBuilder.CreateEmployer(Guid.NewGuid()); var provider = _providerBuilder.CreateProvider(); _localEnterprisePartnershipBuilder.CreateLocalEnterprisePartnership(); _postcodeLookupBuilder.CreatePostcodeLookup(); _savedReferralOpportunityItem = _opportunityBuilder.CreateReferralOpportunityItem(true, false, provider.ProviderVenue.First().Id); _savedProvisionGapOpportunityItem = _opportunityBuilder.CreateProvisionGapOpportunityItem(true, false); _opportunityBuilder.CreateOpportunity(employer.CrmId, new List <OpportunityItem> { _savedReferralOpportunityItem, _savedProvisionGapOpportunityItem }); _result = _dbContext.MatchingServiceOpportunityReport.ToList(); }
public When_MatchingServiceProviderOpportunityReport_Is_Called_For_Multiple_Opportunity_And_Single_Provider_Venue() { _dbContext = new TestConfiguration().GetDbContext(); _opportunityBuilder = new OpportunityBuilder(_dbContext); _providerBuilder = new ProviderBuilder(_dbContext); _employerBuilder = new EmployerBuilder(_dbContext); _postcodeLookupBuilder = new PostcodeLookupBuilder(_dbContext); _localEnterprisePartnershipBuilder = new LocalEnterprisePartnershipBuilder(_dbContext); ClearData(); var employer = _employerBuilder.CreateEmployer(Guid.NewGuid()); _provider = _providerBuilder.CreateProvider(); _localEnterprisePartnershipBuilder.CreateLocalEnterprisePartnership(); _postcodeLookupBuilder.CreatePostcodeLookup(); var savedReferralOpportunityItem1 = _opportunityBuilder.CreateReferralOpportunityItem(true, true, _provider.ProviderVenue.Select(pv => pv.Id).ToArray()); var savedReferralOpportunityItem2 = _opportunityBuilder.CreateReferralOpportunityItem(true, true, _provider.ProviderVenue.Select(pv => pv.Id).ToArray()); _opportunityBuilder.CreateOpportunity(employer.CrmId, new List <OpportunityItem> { savedReferralOpportunityItem1, savedReferralOpportunityItem2 }); _result = _dbContext.MatchingServiceProviderOpportunityReport.ToList(); }
public When_MatchingServiceOpportunityReport_Is_Called_For_Saved_OpportunityOpportunities() { _dbContext = new TestConfiguration().GetDbContext(); _opportunityBuilder = new OpportunityBuilder(_dbContext); _providerBuilder = new ProviderBuilder(_dbContext); _employerBuilder = new EmployerBuilder(_dbContext); ClearData(); var employer = _employerBuilder.CreateEmployer(Guid.NewGuid()); var provider1 = _providerBuilder.CreateProvider(); var provider2 = _providerBuilder.CreateProvider(); _savedReferralOpportunityItem = _opportunityBuilder.CreateReferralOpportunityItem(true, true, provider1.ProviderVenue.First().Id); _savedProvisionGapOpportunityItem = _opportunityBuilder.CreateProvisionGapOpportunityItem(true, true); _unsavedReferralOpportunityItem = _opportunityBuilder.CreateReferralOpportunityItem(false, false, provider2.ProviderVenue.First().Id); _unsavedProvisionGapOpportunityItem = _opportunityBuilder.CreateProvisionGapOpportunityItem(false, false); _opportunityBuilder.CreateOpportunity(employer.CrmId, new List <OpportunityItem> { _savedReferralOpportunityItem, _savedProvisionGapOpportunityItem, _unsavedReferralOpportunityItem, _unsavedProvisionGapOpportunityItem }); _result = _dbContext.MatchingServiceOpportunityReport.ToList(); }
public When_MatchingServiceProviderOpportunityReport_Is_Called_For_Single_Provider_Multiple_Venues() { _dbContext = new TestConfiguration().GetDbContext(); _opportunityBuilder = new OpportunityBuilder(_dbContext); _providerBuilder = new ProviderBuilder(_dbContext); _employerBuilder = new EmployerBuilder(_dbContext); ClearData(); var employer = _employerBuilder.CreateEmployer(Guid.NewGuid()); var provider = _providerBuilder.CreateProvider(2); _savedReferralOpportunityItem = _opportunityBuilder.CreateReferralOpportunityItem(true, true, provider.ProviderVenue.Select(pv => pv.Id).ToArray()); _opportunityBuilder.CreateOpportunity(employer.CrmId, new List <OpportunityItem> { _savedReferralOpportunityItem }); _result = _dbContext.MatchingServiceProviderOpportunityReport.ToList(); }