Exemple #1
0
        public void put_a_dependency_into_the_object_def_for_the_inner_behavior()
        {
            _wrapper.AddAfter(Wrapper.For <FakeBehavior>());
            var def = _wrapper.As <IContainerModel>().ToInstance().As <IConfiguredInstance>();

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

            def.FindDependencyDefinitionFor <IActionBehavior>().ReturnedType
            .ShouldBe(typeof(FakeBehavior));
        }
        public void put_a_dependency_into_the_object_def_for_the_inner_behavior()
        {
            _wrapper.AddAfter(Wrapper.For <FakeBehavior>());
            var def = _wrapper.As <IContainerModel>().ToObjectDef();

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

            var dependency = def.Dependencies.First().ShouldBeOfType <ConfiguredDependency>();

            dependency.DependencyType.ShouldEqual(typeof(IActionBehavior));
            dependency.Definition.Type.ShouldEqual(typeof(FakeBehavior));
        }
Exemple #3
0
        public void put_a_dependency_into_the_object_def_for_the_inner_behavior()
        {
            _wrapper.AddAfter(new ConnegOutputNode(typeof(Output)));
            ObjectDef def = _wrapper.As <IContainerModel>().ToObjectDef(DiagnosticLevel.None);

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

            var dependency = def.Dependencies.First().ShouldBeOfType <ConfiguredDependency>();

            dependency.DependencyType.ShouldEqual(typeof(IActionBehavior));
            dependency.Definition.Type.ShouldEqual(typeof(ConnegOutputBehavior <Output>));
        }
Exemple #4
0
        public void put_a_dependency_into_the_object_def_for_the_inner_behavior()
        {
            _wrapper.AddAfter(new RenderJsonNode(typeof(Output)));
            ObjectDef def = _wrapper.ToObjectDef();

            def.Dependencies.Count.ShouldEqual(1);

            var dependency = def.Dependencies.First().ShouldBeOfType <ConfiguredDependency>();

            dependency.DependencyType.ShouldEqual(typeof(IActionBehavior));
            dependency.Definition.Type.ShouldEqual(typeof(RenderJsonBehavior <Output>));
        }
Exemple #5
0
        public void SetUp()
        {
            WrappedBehaviorWasInvoked = false;
            NextBehaviorWasInvoked    = false;

            theContainer = new Container();
            theContainer.Inject <IDebugReport>(new DebugReport());
            theContainer.Inject(MockRepository.GenerateMock <IDebugDetector>());

            theRequest = new InMemoryFubuRequest();
            theContainer.Inject <IFubuRequest>(theRequest);

            theService = new Service();
            theContainer.Inject(theService);

            theNode = Wrapper.For <MyBehavior>();
            theNode.AddAfter(Wrapper.For <FollowingBehavior>());
        }
        public void SetUp()
        {
            WrappedBehaviorWasInvoked = false;
            NextBehaviorWasInvoked = false;

            theContainer = new Container();
            theContainer.Inject<IDebugReport>(new DebugReport(null, null));
            theContainer.Inject(MockRepository.GenerateMock<IDebugDetector>());

            theRequest = new InMemoryFubuRequest();
            theContainer.Inject<IFubuRequest>(theRequest);

            theService = new Service();
            theContainer.Inject(theService);

            theNode = Wrapper.For<MyBehavior>();
            theNode.AddAfter(Wrapper.For<FollowingBehavior>());
        }
        public void SetUp()
        {
            WrappedBehaviorWasInvoked = false;
            NextBehaviorWasInvoked = false;

            theContainer = new Container();

            theRequest = new InMemoryFubuRequest();
            theContainer.Inject<IFubuRequest>(theRequest);

            theService = new Service();
            theContainer.Inject(theService);

            theNode = Wrapper.For<MyBehavior>();
            theNode.AddAfter(Wrapper.For<FollowingBehavior>());
        }