-
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: Exit application after writing metadata
- Loading branch information
1 parent
94eeafd
commit bde5e30
Showing
7 changed files
with
50 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
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