Skip to content

Instantly share code, notes, and snippets.

@johndowns
Created November 7, 2018 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johndowns/746d2430cc3cb210c4a199e7aaed9f64 to your computer and use it in GitHub Desktop.
Save johndowns/746d2430cc3cb210c4a199e7aaed9f64 to your computer and use it in GitHub Desktop.
[Collection(nameof(FunctionTestCollection))]
public class HelloWorldFunctionTest
{
private readonly FunctionTestFixture _fixture;
private HttpResponseMessage _response;
public HelloWorldFunctionTest(FunctionTestFixture fixture)
{
_fixture = fixture;
}
[Fact]
public void Hello_World_Function_Test()
{
this.BDDfy();
}
private async Task When_The_HelloWorld_Function_Is_Invoked()
{
_response = await _fixture.Client.GetAsync("api/HelloWorld?name=James+Bond");
}
private async Task Then_The_Response_Should_Include_The_Caller_Name()
{
Assert.EndsWith("James Bond", await _response.Content.ReadAsStringAsync());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment