public void SelectAction_ReturnsNull_IfActionIsMissing(string path) { ODataPath odataPath = new DefaultODataPathHandler().Parse(ODataRoutingModel.GetModel(), path); ILookup<string, HttpActionDescriptor> emptyActionMap = new HttpActionDescriptor[0].ToLookup(desc => (string)null); HttpControllerContext controllerContext = new HttpControllerContext(); controllerContext.Request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/"); controllerContext.Request.SetRouteData(new HttpRouteData(new HttpRoute())); string selectedAction = new ActionRoutingConvention().SelectAction(odataPath, controllerContext, emptyActionMap); Assert.Null(selectedAction); Assert.Empty(controllerContext.Request.GetRouteData().Values); }
public void SelectAction_ReturnsNull_IfActionIsMissing(string path) { ODataPath odataPath = new DefaultODataPathHandler().Parse(ODataRoutingModel.GetModel(), path); ILookup <string, HttpActionDescriptor> emptyActionMap = new HttpActionDescriptor[0].ToLookup(desc => (string)null); HttpControllerContext controllerContext = new HttpControllerContext(); controllerContext.Request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/"); controllerContext.Request.SetRouteData(new HttpRouteData(new HttpRoute())); string selectedAction = new ActionRoutingConvention().SelectAction(odataPath, controllerContext, emptyActionMap); Assert.Null(selectedAction); Assert.Empty(controllerContext.Request.GetRouteData().Values); }