Exemplo n.º 1
0
        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_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();
        }