Exemplo n.º 1
0
        public When_Employer_Check_Details_Is_Loaded()
        {
            var config = new MapperConfiguration(c => c.AddMaps(typeof(EmployerDtoMapper).Assembly));
            var mapper = new Mapper(config);

            var employerService = Substitute.For <IEmployerService>();
            var referralService = Substitute.For <IReferralService>();

            employerService.GetOpportunityEmployerDetailAsync(Arg.Any <int>(), Arg.Any <int>()).Returns(new EmployerDetailsViewModel
            {
                OpportunityId     = OpportunityId,
                OpportunityItemId = OpportunityItemId,
                CompanyName       = CompanyName,
                PrimaryContact    = EmployerContact,
                Phone             = EmployerContactPhone,
                Email             = EmployerContactEmail
            });

            var employerController = new EmployerController(employerService, Substitute.For <IOpportunityService>(),
                                                            referralService, mapper);

            _result = employerController.CheckEmployerDetailsAsync(OpportunityId, OpportunityItemId).GetAwaiter().GetResult();
        }