Skip to content

Instantly share code, notes, and snippets.

@zbartl
Last active June 6, 2017 20:55
Show Gist options
  • Save zbartl/f4efbc9d1e111c1da9cd5451ae7af0af to your computer and use it in GitHub Desktop.
Save zbartl/f4efbc9d1e111c1da9cd5451ae7af0af to your computer and use it in GitHub Desktop.
aspnetcore integration test - test 2.0
[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);
Client.DefaultRequestHeaders.Add("my-name", "test");
Client.DefaultRequestHeaders.Add("my-id", "12345");
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