Ejemplo n.º 1
0
        public void SetUp()
        {
            container = new Container(x => x.For <IFileSystem>().Use <FileSystem>());


            graph = new FubuRegistry(x =>
            {
                x.Route <InputModel>("/area/sub/{Name}/{Age}")
                .Calls <TestController>(c => c.AnotherAction(null)).OutputToJson();

                x.Route <InputModel>("/area/sub2/{Name}/{Age}")
                .Calls <TestController>(c => c.AnotherAction(null)).OutputToJson();

                x.Route <InputModel>("/area/sub3/{Name}/{Age}")
                .Calls <TestController>(c => c.AnotherAction(null)).OutputToJson();

                x.Models.ConvertUsing <ExampleConverter>().ConvertUsing <ExampleConverter2>();


                x.Services(s => s.AddService <IActivator>(new StubActivator()));
                x.Services(s => s.AddService <IActivator>(new StubActivator()));
                x.Services(s => s.AddService <IActivator>(new StubActivator()));
            }).BuildGraph();

            facility = new StructureMapContainerFacility(container);
            graph.EachService(facility.Register);

            factory = facility.BuildFactory();
        }