Skip to content

Instantly share code, notes, and snippets.

@zbartl
Last active June 6, 2017 20:55
Show Gist options
  • Save zbartl/6cd91dc44fbfc97cc394cd324fefed5a to your computer and use it in GitHub Desktop.
Save zbartl/6cd91dc44fbfc97cc394cd324fefed5a to your computer and use it in GitHub Desktop.
aspnetcore integration testing - test
[Fact]
public async Task Should_be_able_to_see_secret()
{
var data = new Dictionary<string, string>()
{
{ "email", "test@gmail.com" },
{ "secret", "shh!" }
};
var secretContent = new FormUrlEncodedContent(data);
var result = await Client.PostAsync("/secret-thing", secretContent);
result.Headers.Location.ToString().ShouldBe("/thing-that-is-secret");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment