コード例 #1
0
        public void delegate_to_the_check()
        {
            FakeCheck.Rights = AuthorizationRight.Allow;
            FakeCheck.Created = 0;

            var context = new FubuRequestContext(new StructureMapServiceLocator(new Container()), null, null,null,null);
            var policy = new AuthorizationCheckPolicy<FakeCheck>();

            policy.RightsFor(context).ShouldEqual(AuthorizationRight.Allow);

            FakeCheck.Rights = AuthorizationRight.Deny;

            policy.RightsFor(context).ShouldEqual(AuthorizationRight.Deny);

            FakeCheck.Created.ShouldEqual(2);
        }
コード例 #2
0
        public void delegate_to_the_check()
        {
            FakeCheck.Rights  = AuthorizationRight.Allow;
            FakeCheck.Created = 0;

            var context = new FubuRequestContext(new StructureMapServiceLocator(new Container()), null, null, null, null);
            var policy  = new AuthorizationCheckPolicy <FakeCheck>();

            policy.RightsFor(context).ShouldEqual(AuthorizationRight.Allow);

            FakeCheck.Rights = AuthorizationRight.Deny;

            policy.RightsFor(context).ShouldEqual(AuthorizationRight.Deny);

            FakeCheck.Created.ShouldEqual(2);
        }