Exemple #1
0
        public void should_add_an_HttpMethodConstraint_to_the_route_definition_for_the_method_that_applies()
        {
            _policy.Apply(ActionCall.For <SampleForConstraintPolicy>(c => c.QueryParts()), _routeDefinition, _observer);

            _argsToAddConstraint.First <string>().ShouldEqual(RouteConstraintPolicy.HTTP_METHOD_CONSTRAINT);
            _argsToAddConstraint.Second <IRouteConstraint>().ShouldBeOfType <HttpMethodConstraint>()
            .AllowedMethods.ShouldHaveTheSameElementsAs("GET");
        }
Exemple #2
0
        public void should_add_an_HttpMethodConstraint_to_the_route_definition_for_multiple_methods_that_apply()
        {
            _policy.Apply(ActionCall.For <SampleForConstraintPolicy>(c => c.QueryPartsAndAddCommand()), _routeDefinition);

            _routeDefinition.AllowedHttpMethods.ShouldHaveTheSameElementsAs("GET", "POST");
        }
Exemple #3
0
        public void should_add_an_HttpMethodConstraint_to_the_route_definition_for_the_method_that_applies()
        {
            _policy.Apply(ActionCall.For <SampleForConstraintPolicy>(c => c.QueryParts()), _routeDefinition, _observer);

            _routeDefinition.AllowedHttpMethods.ShouldHaveTheSameElementsAs("GET");
        }