Skip to content

Instantly share code, notes, and snippets.

@GraemeF
Created December 29, 2010 19:51
Show Gist options
  • Save GraemeF/758979 to your computer and use it in GitHub Desktop.
Save GraemeF/758979 to your computer and use it in GitHub Desktop.
Repro exception posting an object with an enum
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