Last active
May 20, 2020 00:21
-
-
Save frankhale/87c41780e9702359dbe9386a92f6b52f to your computer and use it in GitHub Desktop.
Guessing this is not possible?
This file contains hidden or 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 Get_GetDefaultEndPoint_ReturnsOk() | |
{ | |
// Arrange | |
var harness = new InMemoryTestHarness(); | |
var consumerHarness = harness.Consumer<MyMessageConsumer>(); | |
await harness.Start(); | |
try | |
{ | |
// Act | |
// /api/default -> emits a MyMessage onto the Bus | |
var apiResults = await _client.GetAsync("/api/default"); | |
var apiResponse = await apiResults.Content.ReadAsStringAsync(); | |
// Assert | |
apiResults.StatusCode.Should().Be(HttpStatusCode.OK); | |
apiResponse.Should().Be("API1"); | |
consumerHarness.Consumed.Select<MyMessage>().Any().Should().BeTrue(); | |
} | |
finally | |
{ | |
await harness.Stop(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment