public ResourceAction(ConnegActionFinder connegActionActionFinder, ActionCallMapper actionCallMapper, IUrlRegistry urlRegistry, ICurrentHttpRequest currentHttpRequest) { _connegActionActionFinder = connegActionActionFinder; _actionCallMapper = actionCallMapper; _urlRegistry = urlRegistry; _currentHttpRequest = currentHttpRequest; }
public void when_no_methods_are_allowed_default_to_GET() { var result = ActionCallMapper.getRouteVerbs(_route).ToArray(); result.Count().ShouldEqual(1); result[0].ShouldEqual("GET"); }
public ResourceAction(ConnegActionFinder connegActionActionFinder, ActionCallMapper actionCallMapper, IUrlRegistry urlRegistry, ICurrentHttpRequest currentHttpRequest) { _connegActionActionFinder = connegActionActionFinder; _actionCallMapper = actionCallMapper; _urlRegistry = urlRegistry; _currentHttpRequest = currentHttpRequest; }
public void required_should_be_pulled_from_data_annotation() { _property = ReflectionHelper.GetProperty <ActionRequest>(a => a.required); var result = ActionCallMapper.createParameter(_property, _route); result.required.ShouldBeTrue(); }
public void for_normal_input_property_should_have_paramType_post() { var property = ReflectionHelper.GetProperty <ActionRequest>(a => a.redfish); var result = ActionCallMapper.createParameter(property, _route); result.paramType.ShouldEqual("post"); }
public void for_querystring_input_should_have_paramType_query() { var property = ReflectionHelper.GetProperty <ActionRequest>(a => a.query); var result = ActionCallMapper.createParameter(property, _route); result.paramType.ShouldEqual("query"); }
public void Given() { var graph = new BehaviorGraph(); var chain = graph.AddActionFor("api/action1/{input}/", typeof(Action1)); _route = chain.Route; _property = ReflectionHelper.GetProperty <ActionRequest>(a => a.redfish); _result = ActionCallMapper.createParameter(_property, _route); }
public void should_return_allowed_route_methods() { _route.AddHttpMethodConstraint("POST"); _route.AddHttpMethodConstraint("PUT"); var result = ActionCallMapper.getRouteVerbs(_route).ToArray(); result.Count().ShouldEqual(2); result.Contains("POST"); result.Contains("PUT"); }
public void Given() { var cut = new ActionCallMapper(new TypeDescriptorCache()); var graph = new BehaviorGraph(); var chain = graph.AddActionFor("api/group1/{input}", typeof(Action1)); chain.Route.AddHttpMethodConstraint("POST"); var action = graph.Actions().First(); _result = cut.GetSwaggerOperations(action).First(); }
public void Given() { var cut = new ActionCallMapper(new TypeDescriptorCache()); var graph = new BehaviorGraph(); var chain = graph.AddActionFor("api/group1/{input}", typeof(Action1)); chain.Route.AddHttpMethodConstraint("POST"); var action = graph.Actions().First(); _result = cut.GetSwaggerOperations(action).First(); }