public void should_use_hyphen_to_break_up_camel_casing() { _policy .Build(HandlersObjectMother.ComplexHandlerCall()) .Pattern .ShouldEqual("posts/complex-route"); }
public void should_constrain_routes_by_class_name_without_handler() { _policy .Build(HandlersObjectMother.HandlerCall()) .AllowedHttpMethods .ShouldContain("GET"); }
public void should_strip_root_namespace_and_treat_child_namespaces_as_folders() { _policy .Build(HandlersObjectMother.HandlerCall()) .Pattern .ShouldEqual("posts/create"); }
public void should_not_match_calls_with_url_pattern_attribute() { var log = new NulloConfigurationObserver(); _policy .Matches(HandlersObjectMother.HandlerWithAttributeCall(), log) .ShouldBeFalse(); }
public void should_only_match_calls_with_handler_type_ending_with_handler() { _policy .Matches(HandlersObjectMother.HandlerCall()) .ShouldBeTrue(); _policy .Matches(HandlersObjectMother.NonHandlerCall()) .ShouldBeFalse(); }
public void should_only_match_calls_with_handler_type_ending_with_handler() { var log = new NulloConfigurationObserver(); _policy .Matches(HandlersObjectMother.HandlerCall(), log) .ShouldBeTrue(); _policy .Matches(HandlersObjectMother.NonHandlerCall(), log) .ShouldBeFalse(); }
public void should_constrain_routes_by_MethodToUrlBuilder_if_they_match() { var input = _policy.Build(HandlersObjectMother.HandlerWithRouteInput()).Input; var parameters = new RouteParameters(); parameters["Year"] = "2011"; parameters["Month"] = "7"; parameters["Title"] = "hello-world"; input .CreateUrlFromParameters(parameters) .ShouldEqual("posts/2011/7/hello-world"); }
public void should_not_match_calls_with_url_pattern_attribute() { _policy .Matches(HandlersObjectMother.HandlerWithAttributeCall()) .ShouldBeFalse(); }
public void should_apply_input_types_for_verb_handler_convention() { var input = _policy.Build(HandlersObjectMother.VerbHandler()).Input; input.QueryParameters.First().Name.ShouldEqual("Optional"); }
public void should_add_querystrings_to_route_for_handler_convention() { _policy .Build(HandlersObjectMother.HandlerCall()) .Input.QueryParameters.First().Name.ShouldEqual("Input"); }