Example #1
0
        public void adding_a_type_that_is_not_a_rule()
        {
            var node = new AuthorizationNode();

            Exception <ArgumentOutOfRangeException> .ShouldBeThrownBy(() =>
            {
                node.AddRule(GetType());
            });
        }
Example #2
0
        public void adding_a_rule()
        {
            var node = new AuthorizationNode();

            node.AddRule(typeof(UrlModelShouldStartWithJ));

            toBehavior(node).Policies.Single().ShouldBeOfType <AuthorizationPolicy <UrlModel> >()
            .InnerRule.ShouldBeOfType <UrlModelShouldStartWithJ>();
        }