public void adding_a_type_that_is_not_a_rule() { var node = new AuthorizationNode(); Exception <ArgumentOutOfRangeException> .ShouldBeThrownBy(() => { node.AddRule(GetType()); }); }
public void adding_a_rule() { var node = new AuthorizationNode(); node.AddRule(typeof(UrlModelShouldStartWithJ)); toBehavior(node).Policies.Single().ShouldBeOfType <AuthorizationPolicy <UrlModel> >() .InnerRule.ShouldBeOfType <UrlModelShouldStartWithJ>(); }