public UserControllerTests() : base(false) { var environment = new EnvironmentBuilder("LocationServicesClient:Username", "LocationServicesClient:Password", "LocationServicesClient:Url"); var httpContextAccessor = new HttpContextAccessor { HttpContext = HttpResponseTest.SetupHttpContext() }; _controller = new SheriffController(new SheriffService(Db, httpContextAccessor), new UserService(Db), environment.Configuration, Db) { ControllerContext = HttpResponseTest.SetupMockControllerContext() }; }
public SheriffControllerTests() : base(false) { var environment = new EnvironmentBuilder("LocationServicesClient:Username", "LocationServicesClient:Password", "LocationServicesClient:Url"); var httpContextAccessor = new HttpContextAccessor { HttpContext = HttpResponseTest.SetupHttpContext() }; var sheriffService = new SheriffService(Db, environment.Configuration, httpContextAccessor); var shiftService = new ShiftService(Db, sheriffService, environment.Configuration); var dutyRosterService = new DutyRosterService(Db, environment.Configuration, shiftService, environment.LogFactory.CreateLogger <DutyRosterService>()); _controller = new SheriffController(sheriffService, dutyRosterService, shiftService, new UserService(Db), environment.Configuration, Db) { ControllerContext = HttpResponseTest.SetupMockControllerContext() }; }