Exemple #1
0
        public When_Employer_Searched_Successfully()
        {
            const string query = "Employer";

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

            _employerService.Search(query).Returns(new List <EmployerSearchResultDto>
            {
                new EmployerSearchResultDto
                {
                    CompanyName = "CompanyName1",
                    AlsoKnownAs = "AlsoKnownAs1"
                },
                new EmployerSearchResultDto
                {
                    CompanyName = "CompanyName2",
                    AlsoKnownAs = "AlsoKnownAs2"
                }
            });
            var config = new MapperConfiguration(c => c.AddMaps(typeof(EmployerMapper).Assembly));
            var mapper = new Mapper(config);

            var employerController = new EmployerController(_employerService, null, referralService, mapper);

            _result = employerController.SearchEmployer(query);
        }