Exemplo n.º 1
0
        public void build_an_object_def_for_the_type()
        {
            var def = _wrapper.As <IContainerModel>().ToInstance().As <IConfiguredInstance>();

            def.Dependencies.Count().ShouldBe(0);

            def.PluggedType.ShouldBe(typeof(NulloBehavior));
        }
Exemplo n.º 2
0
        public void build_an_object_def_for_the_type()
        {
            var def = _wrapper.As <IContainerModel>().ToObjectDef();

            def.Dependencies.Count().ShouldEqual(0);

            def.Type.ShouldEqual(typeof(NulloBehavior));
        }
        public void creating_an_object_def_for_no_tracing()
        {
            var node = new Wrapper(typeof(SimpleBehavior));

            node.As <IContainerModel>().ToInstance()
            .ReturnedType.ShouldBe(typeof(SimpleBehavior));
        }
Exemplo n.º 4
0
        public void creating_an_object_def_for_no_tracing()
        {
            var node = new Wrapper(typeof(SimpleBehavior));

            node.As <IContainerModel>().ToObjectDef(DiagnosticLevel.None)
            .Type.ShouldEqual(typeof(SimpleBehavior));
        }
Exemplo n.º 5
0
        private IActionBehavior behavior()
        {
            var objectDef = theNode.As <IContainerModel>().ToObjectDef();
            var instance  = new ObjectDefInstance(objectDef);

            return(theContainer.GetInstance <IActionBehavior>(instance));
        }
        public void creating_an_object_def_for_full_tracing_should_wrap_with_a_behavior_tracer()
        {
            var node = new Wrapper(typeof (SimpleBehavior));
            var objectDef = node.As<IContainerModel>().ToObjectDef(DiagnosticLevel.FullRequestTracing);

            objectDef.Type.ShouldEqual(typeof (BehaviorTracer));
            objectDef.DependencyFor<IActionBehavior>().As<ConfiguredDependency>()
                .Definition.Type.ShouldEqual(typeof (SimpleBehavior));
        }
Exemplo n.º 7
0
        public void creating_an_object_def_for_full_tracing_should_wrap_with_a_behavior_tracer()
        {
            var node      = new Wrapper(typeof(SimpleBehavior));
            var objectDef = node.As <IContainerModel>().ToObjectDef(DiagnosticLevel.FullRequestTracing);

            objectDef.Type.ShouldEqual(typeof(BehaviorTracer));
            objectDef.DependencyFor <IActionBehavior>().As <ConfiguredDependency>()
            .Definition.Type.ShouldEqual(typeof(SimpleBehavior));
        }
 public void creating_an_object_def_for_no_tracing()
 {
     var node = new Wrapper(typeof (SimpleBehavior));
     node.As<IContainerModel>().ToObjectDef(DiagnosticLevel.None)
         .Type.ShouldEqual(typeof (SimpleBehavior));
 }
 public void creating_an_object_def_for_no_tracing()
 {
     var node = new Wrapper(typeof (SimpleBehavior));
     node.As<IContainerModel>().ToInstance()
         .ReturnedType.ShouldBe(typeof (SimpleBehavior));
 }