public When_Employer_Consent_Is_Loaded() { var config = new MapperConfiguration(c => c.AddMaps(typeof(EmployerDtoMapper).Assembly)); var referralService = Substitute.For <IReferralService>(); var mapper = new Mapper(config); _employerService = Substitute.For <IEmployerService>(); _employerService.GetOpportunityEmployerDetailAsync(Arg.Any <int>(), Arg.Any <int>()).Returns(new EmployerDetailsViewModel { OpportunityId = 1, OpportunityItemId = 2, CompanyName = "CompanyName", AlsoKnownAs = "CompanyNameAka", PrimaryContact = "EmployerContact", Phone = "EmployerContactPhone", Email = "EmployerContactEmail" }); _opportunityService = Substitute.For <IOpportunityService>(); _opportunityService.GetReferredOpportunityItemCountAsync(1).Returns(10); var employerController = new EmployerController(_employerService, _opportunityService, referralService, mapper); _result = employerController.GetEmployerConsentAsync(1, 2).GetAwaiter().GetResult(); }