public void add_constraint_to_route_with_model()
        {
            var url = new RouteDefinition<SampleViewModel>("my/sample");
            var constraintToAdd = new HttpMethodConstraint("POST");
            url.AddRouteConstraint("httpMethod", constraintToAdd);
            Route route = url.ToRoute();

            route.Constraints["httpMethod"].ShouldEqual(constraintToAdd);
        }
Esempio n. 2
0
        public void add_constraint_to_route_with_model()
        {
            var parent = new RouteDefinition("my/sample");
            parent.Input = new RouteInput<SampleViewModel>(parent);
            var constraintToAdd = new HttpMethodConstraint("POST");
            parent.AddRouteConstraint("httpMethod", constraintToAdd);
            Route route = parent.ToRoute();

            route.Constraints["httpMethod"].ShouldEqual(constraintToAdd);
        }