Last active
June 6, 2017 20:55
-
-
Save zbartl/f4efbc9d1e111c1da9cd5451ae7af0af to your computer and use it in GitHub Desktop.
aspnetcore integration test - test 2.0
This file contains 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
[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