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") })); }
public VacationPageController(IVacationPageService vacationPageService, IMapper mapper) { _vacationPageService = vacationPageService; _mapper = mapper; }