public void GetPolicyAsync_2() { var opt = new AuthorizationOptions(); opt.AddPolicy("test", p => p.Requirements.Add(new NameAuthorizationRequirement("test"))); var provider = new AuthorizationPolicyProvider(new OptionsWrapper <AuthorizationOptions>(opt)); Should.NotThrow(() => provider.GetPolicyAsync("test")).Requirements.ShouldHaveSingleItem().ShouldBeOfType <NameAuthorizationRequirement>(); }
public void GetPolicyAsync() { var provider = new AuthorizationPolicyProvider(new OptionsWrapper <AuthorizationOptions>(new AuthorizationOptions())); Should.NotThrow(() => provider.GetPolicyAsync("test")).Requirements.ShouldHaveSingleItem().ShouldBeOfType <PermissionRequirement>(); }