コード例 #1
0
        public BaseController(BaseServiceCollection baseServiceCollection)
        {
            if (baseServiceCollection == null) return;

            AccountService = baseServiceCollection.AccountService;
            AuthenticationService = baseServiceCollection.AuthenticationService;
            ImageService = baseServiceCollection.ImageService;
        }
コード例 #2
0
 public EventsController(BaseServiceCollection baseServiceCollection, IEventService eventService)
     : base(baseServiceCollection)
 {
     _eventService = eventService;
 }
コード例 #3
0
 public AccountsController(BaseServiceCollection baseServiceCollection)
     : base(baseServiceCollection)
 {
 }
コード例 #4
0
 public HomeController(BaseServiceCollection baseServiceCollection)
     : base(baseServiceCollection)
 {
 }
コード例 #5
0
 public AdminBaseController(BaseServiceCollection baseServiceCollection)
     : base(baseServiceCollection)
 {
 }
コード例 #6
0
 public PositionsController(BaseServiceCollection baseServiceCollection, IPositionService positionService)
     : base(baseServiceCollection)
 {
     _positionService = positionService;
 }
コード例 #7
0
 public MockBaseController(BaseServiceCollection serviceCollection)
     : base(serviceCollection)
 {
 }
コード例 #8
0
 private void SetupGetLogInForAuthenticatedUser()
 {
     var mockUser = new MockUser { Identity = new MockIdentity("", "", true) };
     var mockHttpContext = new MockHttpContextBase { User = mockUser };
     var controllerContext = new ControllerContext { HttpContext = mockHttpContext };
     var accountService = new Mock<IAccountService>();
     accountService.Setup(x => x.GetUserByEmailAddress(It.IsAny<string>())).Returns(new User());
     var baseServiceCollection = new BaseServiceCollection(accountService.Object, null, null);
     _accountController = new AccountsController(baseServiceCollection) { ControllerContext = controllerContext };
 }
コード例 #9
0
 private void SetupGetEditEvent()
 {
     var eventService = new Mock<IEventService>();
     eventService.Setup(x => x.GetEventById(It.IsAny<long>())).Returns(new Event { Flyer = new Image() });
     var accountService = new Mock<IAccountService>();
     accountService.Setup(x => x.GetUserByEmailAddress(It.IsAny<string>())).Returns(new User { FirstName = "Test", LastName = "Test" });
     var httpContext = new MockHttpContextBase { User = new MockUser { Identity = new MockIdentity("", "", false) } };
     var baseServices = new BaseServiceCollection(accountService.Object, null, null);
     _eventsController = new EventsController(baseServices, eventService.Object)
                             {
                                 ControllerContext = new ControllerContext(httpContext, new RouteData(), new BaseController(baseServices))
                             };
 }