// Environment set-up public EventRosterControllerTests() { _hashingModule = new HashingModule(); _dbContext = GenerateTestDbContext(); _eventController = SetupControllerContext(new EventController(_dbContext)); _userController = SetupControllerContext(new UserController(_dbContext)); _eventRosterController = SetupControllerContext(new EventRosterController(_dbContext)); }
private EventRosterController SetupControllerContext(EventRosterController controller) { var controllerContext = new ControllerContext { HttpContext = new DefaultHttpContext() }; controller.ControllerContext = controllerContext; return(controller); }