Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Renamed HttpMethod class to HttpMethods to avoid conflicts #714

Merged
merged 1 commit into from
Sep 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Microsoft.AspNetCore.Http
{
public static class HttpMethod
public static class HttpMethods
{
public static readonly string Connect = "CONNECT";
public static readonly string Delete = "DELETE";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ public void OwinHttpEnvironmentCanBeCreated()
{
var env = new Dictionary<string, object>
{
{ "owin.RequestMethod", HttpMethod.Post },
{ "owin.RequestMethod", HttpMethods.Post },
{ "owin.RequestPath", "/path" },
{ "owin.RequestPathBase", "/pathBase" },
{ "owin.RequestQueryString", "name=value" },
};
var features = new OwinFeatureCollection(env);

var requestFeature = Get<IHttpRequestFeature>(features);
Assert.Equal(requestFeature.Method, HttpMethod.Post);
Assert.Equal(requestFeature.Method, HttpMethods.Post);
Assert.Equal(requestFeature.Path, "/path");
Assert.Equal(requestFeature.PathBase, "/pathBase");
Assert.Equal(requestFeature.QueryString, "?name=value");
Expand All @@ -45,20 +45,20 @@ public void OwinHttpEnvironmentCanBeModified()
{
var env = new Dictionary<string, object>
{
{ "owin.RequestMethod", "POST" },
{ "owin.RequestMethod", HttpMethods.Post },
{ "owin.RequestPath", "/path" },
{ "owin.RequestPathBase", "/pathBase" },
{ "owin.RequestQueryString", "name=value" },
};
var features = new OwinFeatureCollection(env);

var requestFeature = Get<IHttpRequestFeature>(features);
requestFeature.Method = "GET";
requestFeature.Method = HttpMethods.Get;
requestFeature.Path = "/path2";
requestFeature.PathBase = "/pathBase2";
requestFeature.QueryString = "?name=value2";

Assert.Equal("GET", Get<string>(env, "owin.RequestMethod"));
Assert.Equal(HttpMethods.Get, Get<string>(env, "owin.RequestMethod"));
Assert.Equal("/path2", Get<string>(env, "owin.RequestPath"));
Assert.Equal("/pathBase2", Get<string>(env, "owin.RequestPathBase"));
Assert.Equal("name=value2", Get<string>(env, "owin.RequestQueryString"));
Expand Down