示例#1
0
        public void use_custom_auth_failure_handler_by_type()
        {
            var node = new AuthorizationNode();

            node.FailureHandler <FakeAuthHandler>();

            var def = node.As <IContainerModel>().ToInstance().As <IConfiguredInstance>();

            def.FindDependencyDefinitionFor <IAuthorizationFailureHandler>()
            .ReturnedType.ShouldBe(typeof(FakeAuthHandler));
        }
示例#2
0
        public void use_custom_auth_failure_handler_by_type()
        {
            var node = new AuthorizationNode();

            node.FailureHandler <FakeAuthHandler>();

            var def = node.As <IContainerModel>().ToObjectDef();

            def.DependencyFor <IAuthorizationFailureHandler>().ShouldBeOfType <ConfiguredDependency>()
            .Definition.Type.ShouldEqual(typeof(FakeAuthHandler));
        }
示例#3
0
        public void use_custom_failure_handler_by_value()
        {
            var node = new AuthorizationNode();

            var handler = new FakeAuthHandler();

            node.FailureHandler(handler);

            var def = node.As <IContainerModel>().ToInstance().As <IConfiguredInstance>();

            def.FindDependencyValueFor <IAuthorizationFailureHandler>().ShouldBeTheSameAs(handler);
        }
示例#4
0
        public void use_custom_failure_handler_by_value()
        {
            var node = new AuthorizationNode();

            var handler = new FakeAuthHandler();

            node.FailureHandler(handler);

            var def = node.As <IContainerModel>().ToObjectDef();

            def.DependencyFor <IAuthorizationFailureHandler>().ShouldBeOfType <ConfiguredDependency>()
            .Definition.Value.ShouldBeTheSameAs(handler);
        }
        public void use_custom_failure_handler_by_value()
        {
            var node = new AuthorizationNode();

            var handler = new FakeAuthHandler();

            node.FailureHandler(handler);

            var def = node.As<IContainerModel>().ToInstance().As<IConfiguredInstance>();

            def.FindDependencyValueFor<IAuthorizationFailureHandler>().ShouldBeTheSameAs(handler);
        }
        public void use_custom_auth_failure_handler_by_type()
        {
            var node = new AuthorizationNode();
            node.FailureHandler<FakeAuthHandler>();

            var def = node.As<IContainerModel>().ToInstance().As<IConfiguredInstance>();

            def.FindDependencyDefinitionFor<IAuthorizationFailureHandler>()
                .ReturnedType.ShouldBe(typeof (FakeAuthHandler));
        }