public void HttpMethod_Works(string fromMethod, string toMethod, string requestMethod, string expected) { var httpContext = new DefaultHttpContext(); var context = new RequestParametersTransformContext() { Method = requestMethod, HttpContext = httpContext }; var transform = new HttpMethodTransform(fromMethod, toMethod); transform.Apply(context); Assert.Equal(expected, context.Method); }
public void HttpMethod_Works(string fromMethod, string toMethod, string requestMethod, string expected) { var httpContext = new DefaultHttpContext(); var request = new HttpRequestMessage() { Method = new HttpMethod(requestMethod) }; var context = new RequestParametersTransformContext() { HttpContext = httpContext, ProxyRequest = request, }; var transform = new HttpMethodTransform(fromMethod, toMethod); transform.Apply(context); Assert.Equal(expected, request.Method.Method); }