Пример #1
0
        public void TestInitializer()
        {
            _vacationPageService = Substitute.For <IVacationPageService>();

            _vacationPageController = new VacationPageController(_vacationPageService, ModelMapper.Create());

            _vacationPageController.ControllerContext = Substitute.For <HttpControllerContext>();
            _vacationPageController.Request           = new HttpRequestMessage();
            _vacationPageController.Request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration());
            _vacationPageController.Request.SetConfiguration(new HttpConfiguration());
            _vacationPageController.RequestContext.Principal =
                new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim(ClaimTypes.NameIdentifier, "1"), new Claim("OrganizationId", "1") }));
        }
Пример #2
0
 public VacationPageController(IVacationPageService vacationPageService, IMapper mapper)
 {
     _vacationPageService = vacationPageService;
     _mapper = mapper;
 }