Created
January 19, 2017 06:25
-
-
Save justinyoo/2bc32a57005d64b3288361a22d17aa49 to your computer and use it in GitHub Desktop.
Testing Precompiled Azure Functions
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
public class MyHttpTriggerTest | |
{ | |
[Theory] | |
[InlineData("Azure")] | |
[InlineData("Dependency")] | |
public async void Given_Dependency_HttpTrigger_ShouldReturn_Result(string name) | |
{ | |
// Arrange | |
var req = new HttpRequestMessage() | |
{ | |
Content = new StringContent(string.Empty), | |
RequestUri = new Uri($"http://localhost?name={name}") | |
}; | |
var log = new TraceMonitor(); | |
// Act | |
var result = await MyHttpTrigger.Run(req, log).ConfigureAwait(false); | |
// Assert | |
var content = await result.Content.ReadAsStringAsync().ConfigureAwait(false); | |
content.Should().ContainEquivalentOf($"Hello {name}"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment