Beispiel #1
0
        public void adds_convention_based_home_policy_if_not_specified()
        {
            RouteDetermination.Configure(graph, resolver);
            var route = buildRoute <HomeEndpoint>(x => x.Index(), c => { });

            route.Pattern.ShouldEqual("");
        }
Beispiel #2
0
        public void leaves_home_policy_alone_if_already_specified()
        {
            resolver.DefaultUrlPolicy.IgnoreClassSuffix("endpoint");
            resolver.DefaultUrlPolicy.IgnoreControllerNamespaceEntirely = true;
            resolver.RegisterUrlPolicy(new DefaultRouteMethodBasedUrlPolicy(ReflectionHelper.GetMethod <RouteResolverController>(x => x.Index())));

            RouteDetermination.Configure(graph, resolver);

            var route = buildRoute <HomeEndpoint>(x => x.Index(), c => { });

            route.Pattern.ShouldEqual("home/index");
        }