protected override void OnApplicationStarted() { base.OnApplicationStarted(); AreaRegistration.RegisterAllAreas(); FluentSecurityConfig.Configure(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BootstrapBundleConfig.RegisterBundles(BundleTable.Bundles); ExampleLayoutsRouteConfig.RegisterRoutes(RouteTable.Routes); AutoMapperConfiguration.Configure(); }
public void FactMethodName() { FluentSecurityConfig.SetupFluentSecurity(); //FluentSecurityConfig.SetupFluentSecurity(); var results = SecurityConfiguration.Current.Verify(expectations => { expectations.Expect <HomeController>().Has <IgnorePolicy>(); }); Assert.True(results.Valid()); }
public void AccountController_ChangePasswordRequiresAnyRole() { FluentSecurityConfig.SetupFluentSecurity(); //var results = SecurityConfiguration.Current.Verify(expectations => //{ // expectations.Expect<AccountController>(x => x.ChangePassword()) // .Has<RequireAnyRolePolicy>( // p => p.RolesRequired.Contains("Administrator") && // p.RolesRequired.Count() == 1); //}); //Assert.True(results.Valid()); }