Ejemplo n.º 1
0
        public void add_a_custom_no_resource_handler()
        {
            var node = new OutputNode(typeof(Address));

            node.UseForResourceNotFound <MyFakeResourceNotHandler>();

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

            def.FindDependencyDefinitionFor <IResourceNotFoundHandler>()
            .ReturnedType.ShouldBe(typeof(MyFakeResourceNotHandler));
        }
Ejemplo n.º 2
0
        public void add_a_custom_no_resource_handler()
        {
            var node = new OutputNode(typeof(Address));

            node.UseForResourceNotFound <MyFakeResourceNotHandler>();

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

            def.FindDependencyDefinitionFor <IResourceNotFoundHandler>()
            .Type.ShouldEqual(typeof(MyFakeResourceNotHandler));
        }