-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBitNetPaperAuditCommand.cs
More file actions
36 lines (30 loc) · 1.17 KB
/
BitNetPaperAuditCommand.cs
File metadata and controls
36 lines (30 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System.Text;
using BitNetSharp.Core;
namespace BitNetSharp.App;
public static class BitNetPaperAuditCommand
{
public static string FormatReport(BitNetPaperAuditReport report)
{
ArgumentNullException.ThrowIfNull(report);
var builder = new StringBuilder();
builder.AppendLine($"Paper-alignment audit: {report.ModelId}");
builder.AppendLine(report.DisplayName);
builder.AppendLine($"Passed: {report.PassedCount}");
builder.AppendLine($"Pending: {report.PendingCount}");
builder.AppendLine($"Failed: {report.FailedCount}");
builder.AppendLine();
foreach (var check in report.Checks)
{
builder.AppendLine($"[{FormatStatus(check.Status)}] {check.Area} - {check.Requirement}");
builder.AppendLine($" {check.Details}");
}
return builder.ToString().TrimEnd();
}
private static string FormatStatus(BitNetPaperAuditStatus status) => status switch
{
BitNetPaperAuditStatus.Passed => "PASS",
BitNetPaperAuditStatus.Pending => "PENDING",
BitNetPaperAuditStatus.Failed => "FAIL",
_ => status.ToString().ToUpperInvariant()
};
}