-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SIANXSVC-1206: dotnet-e5e writes logging messages after output in non…
…-keepalive mode (#19)
- Loading branch information
1 parent
25b1009
commit a63c6e9
Showing
4 changed files
with
61 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System.Threading.Tasks; | ||
|
||
using Anexia.E5E.Functions; | ||
using Anexia.E5E.Tests.Helpers; | ||
using Anexia.E5E.Tests.TestHelpers; | ||
|
||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace Anexia.E5E.Tests.Integration; | ||
|
||
public class NonKeepAliveModeTests : IntegrationTestBase | ||
{ | ||
public NonKeepAliveModeTests(ITestOutputHelper outputHelper) : base(outputHelper) | ||
{ | ||
Host.ConfigureEndpoints(cfg => | ||
{ | ||
cfg.RegisterEntrypoint(TestE5ERuntimeOptions.DefaultEntrypointName, | ||
_ => Task.FromResult(E5EResponse.From("response"))); | ||
}, new[] { TestE5ERuntimeOptions.DefaultEntrypointName, "+++", "0", "---" }); | ||
} | ||
|
||
public override Task InitializeAsync() => Host.StartAsync(); | ||
|
||
|
||
[Fact] | ||
public async Task ShouldEndWithJsonResponse() | ||
{ | ||
var (stdout, _) = await Host.WriteOnceAsync(builder => builder.WithData("request")); | ||
Assert.EndsWith(@"{""result"":{""data"":""response"",""type"":""text""}}", stdout); | ||
} | ||
|
||
[Fact] | ||
public async Task ShouldNotWriteExecutionEndToStderr() | ||
{ | ||
var (_, stderr) = await Host.WriteOnceAsync(builder => builder.WithData("request")); | ||
Assert.Empty(stderr); | ||
} | ||
} |
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
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
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