コード例 #1
0
        public override void StartServer()
        {
            base.StartServer();

            Users = new List <ApplicationUser>();

            var contentProvider = SystemUnderTest.GetMvcApp1ContentProvider();

            Server.UseStatic(contentProvider);

            _webSecurity = new FakeWebSecurity(Users);
            Server.AddModule(new AuthenticationModule(() => _webSecurity.CurrentUser));

            var controllers = new ControllerContainer()
                              .RegisterController("home", ctx => new HomeController())
                              .RegisterController("account", ctx => new AccountController(WebSecurity));


            Server.UseMvc(controllers, contentProvider)
            .WithBundles(BundleConfig.RegisterBundles);
        }
コード例 #2
0
        public override void StartServer()
        {
            base.StartServer();

            Users = new List<ApplicationUser>();

            var contentProvider = SystemUnderTest.GetMvcApp1ContentProvider();
            Server.UseStatic(contentProvider);

            _webSecurity = new FakeWebSecurity(Users);
            Server.AddModule(new AuthenticationModule(ctx => _webSecurity.CurrentUser));


            var controllers = new ControllerContainer()
                .RegisterController("home", ctx => new HomeController())
                .RegisterController("account", ctx => new AccountController(WebSecurity));


            Server.UseMvc(controllers, contentProvider)
                .WithBundles(BundleConfig.RegisterBundles);
        }