コード例 #1
0
        public void SetUp()
        {
            graph = new FubuRegistry(x =>
            {
                x.Route <Registration.InputModel>("/area/sub/{Name}/{Age}")
                .Calls <InputController>(c => c.DoSomething(null)).OutputToJson();
            }).BuildGraph();


            route = graph.RoutesFor <Registration.InputModel>().First();
        }
コード例 #2
0
        public void routes_for_should_get_all_route_definitions_for_declared_type()
        {
            var graph = new FubuRegistry(x =>
            {
                x.Applies.ToAssemblyContainingType <FakeInputModel>();
                x.Actions.IncludeClassesSuffixedWithController();
            }).BuildGraph();

            const string expectedPattern = "fubumvc/tests/registration/fake/query";

            graph.RoutesFor <FakeInputModel>().ShouldHaveCount(1)
            .ShouldContain(routeDef => routeDef.Pattern == expectedPattern);
        }