Created
December 29, 2010 19:51
-
-
Save GraemeF/758979 to your computer and use it in GitHub Desktop.
Repro exception posting an object with an enum
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Net; | |
using EasyHttp.Http; | |
using Should.Fluent; | |
using Xunit; | |
namespace Tests | |
{ | |
public class HttpClientTests | |
{ | |
[Fact] | |
public void Post_WhenUriIsMissingOnServer_ShouldRespondNotFound() | |
{ | |
var client = new HttpClient(); | |
client.Post("http://graemef.com/thisdoesnotexist", new Foo(), "application/vnd.fubar+json"); | |
client.Response.StatusCode.Should().Equal(HttpStatusCode.NotFound); | |
} | |
} | |
public class Foo | |
{ | |
public Bar Baz { get; set; } | |
} | |
public enum Bar | |
{ | |
First, | |
Second, | |
Third | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment