Skip to content

Instantly share code, notes, and snippets.

@skinny
Created May 3, 2012 18:51
Show Gist options
  • Save skinny/2588082 to your computer and use it in GitHub Desktop.
Save skinny/2588082 to your computer and use it in GitHub Desktop.
[Fact]
public void Should_return_null_response_with_RequiresAuthentication_enabled_for_POST_requests_and_hit_with_GET()
{
var module = new FakeHookedModule(A.Fake<BeforePipeline>());
module.RequiresAuthentication().For("POST");
module.Get["/"] = _ => { return "GET"; };
module.Post["/"] = _ => { return "POST"; };
var bootstrapper = new ConfigurableBootstrapper();
var browser = new Browser(bootstrapper);
var postResult = browser.Post("/");
postResult.ShouldNotBeNull();
postResult.StatusCode.ShouldEqual(HttpStatusCode.Unauthorized);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment