public void sends_the_constructor_args_and_parameters_to_the_visitor()
        {
            var dependencies = new DependencyCollection();
            dependencies.Add(typeof (Rule), new ColorRule("Red"));
            dependencies.Add(typeof (IWidget), new AWidget());

            var build = ConcreteType.BuildSource(typeof (GuyWithCtorAndArgs), null, dependencies,
                Policies.Default());

            var visitor = new StubVisitor();
            build.AcceptVisitor(visitor);

            visitor.Items.ShouldHaveTheSameElementsAs(
                "Constructor: Void .ctor(StructureMap.Testing.Widget3.IGateway, StructureMap.Testing.Widget.Rule)",
                "Set IWidget Widget = Value: StructureMap.Testing.Widget.AWidget",
                "Set IService Service = *Default of IService*"
                );
        }
Ejemplo n.º 2
0
        public void sends_the_constructor_args_and_parameters_to_the_visitor()
        {
            var dependencies = new DependencyCollection();

            dependencies.Add(typeof(Rule), new ColorRule("Red"));
            dependencies.Add(typeof(IWidget), new AWidget());

            var build = ConcreteType.BuildSource(typeof(GuyWithCtorAndArgs), null, dependencies,
                                                 new Policies());

            var visitor = new StubVisitor();

            build.AcceptVisitor(visitor);

            visitor.Items.ShouldHaveTheSameElementsAs(
                "Constructor: Void .ctor(StructureMap.Testing.Widget3.IGateway, StructureMap.Testing.Widget.Rule)",
                "Set IWidget Widget = Value: StructureMap.Testing.Widget.AWidget",
                "Set IService Service = *Default of IService*"
                );
        }