Example #1
0
        public void Evaluate_should_succeed_for_valid_roles()
        {
            _perm.Roles.Add("foo");
            var result = LocalPermissionService.Evaluate(_perm, new[] { "foo" });

            result.Should().BeTrue();
        }
Example #2
0
        public void Evaluate_should_fail_for_invalid_roles()
        {
            var result = LocalPermissionService.Evaluate(_perm, new[] { "foo" });

            result.Should().BeFalse();
        }
Example #3
0
        public void Evaluate_should_require_roles()
        {
            Action a = () => LocalPermissionService.Evaluate(_perm, null);

            a.Should().Throw <ArgumentNullException>();
        }