Skip to content

Commit

Permalink
Adding OPTIONS http verb
Browse files Browse the repository at this point in the history
  • Loading branch information
neilcampbell committed Nov 16, 2017
1 parent 8183b5c commit 63bf5b2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public void Convert_WithPostHttpVerb_ReturnsPostHttpMethod()
Assert.Equal(HttpMethod.Post, httpMethod);
}


[Fact]
public void Convert_WithPutHttpVerb_ReturnsPutHttpMethod()
{
Expand Down Expand Up @@ -72,7 +71,6 @@ public void Convert_WithHeadHttpVerb_ReturnsHeadHttpMethod()
Assert.Equal(HttpMethod.Head, httpMethod);
}


[Fact]
public void Convert_WithPatchHttpVerb_ReturnsPatchHttpMethod()
{
Expand All @@ -83,6 +81,16 @@ public void Convert_WithPatchHttpVerb_ReturnsPatchHttpMethod()
Assert.Equal("PATCH", httpMethod.ToString());
}

[Fact]
public void Convert_WithOptionsHttpVerb_ReturnsOptionsHttpMethod()
{
var mapper = GetSubject();

var httpMethod = mapper.Convert(HttpVerb.Options);

Assert.Equal(HttpMethod.Options, httpMethod);
}

[Fact]
public void Convert_WithNotSetHttpVerb_ThrowsArgumentException()
{
Expand Down
3 changes: 2 additions & 1 deletion PactNet/Mocks/MockHttpService/Mappers/HttpMethodMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ internal class HttpMethodMapper : IHttpMethodMapper
{ HttpVerb.Put, HttpMethod.Put },
{ HttpVerb.Delete, HttpMethod.Delete },
{ HttpVerb.Head, HttpMethod.Head },
{ HttpVerb.Patch, new HttpMethod("PATCH") }
{ HttpVerb.Patch, new HttpMethod("PATCH") },
{ HttpVerb.Options, HttpMethod.Options }
};

public HttpMethod Convert(HttpVerb from)
Expand Down
3 changes: 2 additions & 1 deletion PactNet/Mocks/MockHttpService/Models/HttpVerb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public enum HttpVerb
Put,
Delete,
Head,
Patch
Patch,
Options
}
}

0 comments on commit 63bf5b2

Please sign in to comment.