public void Evaluate_should_fail_for_invalid_role() { var user = TestUser.Create("1"); var result = LocalRoleService.Evaluate(user, _role); result.Should().BeFalse(); }
public void Evaluate_should_succeed_for_valid_role() { _role.IdentityRoles.Add("foo"); var user = TestUser.Create("1", roles: new[] { "foo" }); var result = LocalRoleService.Evaluate(user, _role); result.Should().BeTrue(); }
public void Evaluate_should_succeed_for_valid_subject() { _role.Subjects.Add("1"); var user = TestUser.Create("1"); var result = LocalRoleService.Evaluate(user, _role); result.Should().BeTrue(); }
public void Evaluate_should_require_user() { Action a = () => LocalRoleService.Evaluate(null, _role); a.Should().Throw <ArgumentNullException>(); }