LotSizingDataModel.Checker.Cli
2.0.1
Command-line interface for solution checking and validation workflows.
Loading...
Searching...
No Matches
CliExitCodePolicy.cs
Go to the documentation of this file.
1
using
LotSizingDataModel.Checker.Campaign;
2
3
namespace
LotSizingDataModel.Checker.Cli
;
4
5
/// <summary>
6
/// Determines the process exit code corresponding to one completed checker
7
/// campaign.
8
/// </summary>
9
internal
static
class
CliExitCodePolicy
10
{
11
/// <summary>
12
/// Maps a completed campaign result to a stable CLI exit code.
13
/// </summary>
14
/// <param name="result">Completed campaign result.</param>
15
/// <returns>The exit code to return from the checker process.</returns>
16
public
static
CliExitCode
Determine
(
17
DirectoryVerificationCampaignResult result)
18
{
19
ArgumentNullException.ThrowIfNull(result);
20
21
if
(result.FileLoadFailureCount > 0 ||
22
result.BatchResult.ExecutionFailureCount > 0)
23
{
24
return
CliExitCode
.ExecutionFailure;
25
}
26
27
if
(result.BatchResult.InvalidCandidateCount > 0)
28
{
29
return
CliExitCode
.ValidationFailed;
30
}
31
32
return
CliExitCode
.Success;
33
}
34
}
LotSizingDataModel.Checker.Cli.CliExitCodePolicy
Determines the process exit code corresponding to one completed checker campaign.
Definition
CliExitCodePolicy.cs:10
LotSizingDataModel.Checker.Cli.CliExitCodePolicy.Determine
static CliExitCode Determine(DirectoryVerificationCampaignResult result)
Maps a completed campaign result to a stable CLI exit code.
Definition
CliExitCodePolicy.cs:16
LotSizingDataModel.Checker.Cli
Definition
CliExitCode.cs:1
LotSizingDataModel.Checker.Cli.CliExitCode
CliExitCode
Definition
CliExitCode.cs:4
LotSizingDataModel.Checker.Cli
Cli
CliExitCodePolicy.cs
Generated by
1.17.0