-
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-1186: Terminate application after writing metadata (#20)
* SIANXSVC-1186: Update documentation for dotnet-e5e for service initialization * SIANXSVC-1186: Exit application after writing metadata Closes SIANXSVC-1186
- Loading branch information
1 parent
07038d8
commit 25b1009
Showing
8 changed files
with
68 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Anexia.E5E.Abstractions.Termination; | ||
|
||
namespace Anexia.E5E.Tests.TestHelpers; | ||
|
||
public class TerminatorMock : ITerminator | ||
{ | ||
public void Exit() { Called = true; } | ||
|
||
public bool Called { get; private set; } | ||
} |
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
6 changes: 6 additions & 0 deletions
6
src/Anexia.E5E/Abstractions/Termination/EnvironmentTerminator.cs
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,6 @@ | ||
namespace Anexia.E5E.Abstractions.Termination; | ||
|
||
internal sealed class EnvironmentTerminator : ITerminator | ||
{ | ||
public void Exit() => Environment.Exit(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Anexia.E5E.Abstractions.Termination; | ||
|
||
/// <summary> | ||
/// Because the usage of <see cref="Environment.Exit"/> would also crash our test processes, it is abstracted. | ||
/// By default, the <see cref="EnvironmentTerminator"/> is used as implementation. | ||
/// </summary> | ||
internal interface ITerminator | ||
{ | ||
void Exit(); | ||
} |
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