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.
1using LotSizingDataModel.Checker.Campaign;
2
4
5/// <summary>
6/// Determines the process exit code corresponding to one completed checker
7/// campaign.
8/// </summary>
9internal 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}
Determines the process exit code corresponding to one completed checker campaign.
static CliExitCode Determine(DirectoryVerificationCampaignResult result)
Maps a completed campaign result to a stable CLI exit code.