Пример #1
0
 // 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));
 }
Пример #2
0
        private EventRosterController SetupControllerContext(EventRosterController controller)
        {
            var controllerContext = new ControllerContext
            {
                HttpContext = new DefaultHttpContext()
            };

            controller.ControllerContext = controllerContext;
            return(controller);
        }