513fa1aa16
Comment/XML-doc changes only: - add summaries to ~10k test methods, fixtures, fakes and helpers (+ <param> on theories, <returns> on async Task methods, <inheritdoc/> on interface implementations the checker can resolve) - strip ~2.6k project-tracking references (WP*, P*-*, row-NN, Task N, #NN, Component-0NN) from comments, keeping the explanatory text; reword false positives in comments only - real docs on fakes implementing BCL/library interfaces (IDisposable, ILogger, IOptionsMonitor, IAsyncLifetime) - reword the last 5 src/ false positives (CWE-1236, failures-1, year-0001, M365) Only non-comment edits: four one-line nested classes split across lines so members can carry docs. Build 0 errors / 0 warnings.
35 lines
1.5 KiB
C#
35 lines
1.5 KiB
C#
using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit;
|
|
using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums;
|
|
|
|
namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Audit;
|
|
|
|
/// <summary>
|
|
/// Flow Debugger (design 2026-09-05): the <c>ScriptTrace</c> channel and its four kinds must
|
|
/// fit the central <c>AuditLog.Category</c>/<c>Kind</c> columns and never move existing ordinals.
|
|
/// </summary>
|
|
public class ScriptTraceEnumTests
|
|
{
|
|
/// <summary>Verifies that each script trace kind fits the central audit columns.</summary>
|
|
/// <param name="kind">The script trace audit kind under test.</param>
|
|
[Theory]
|
|
[InlineData(AuditKind.RouteCall)]
|
|
[InlineData(AuditKind.ScriptRun)]
|
|
[InlineData(AuditKind.AttributeWrite)]
|
|
[InlineData(AuditKind.AttributeWait)]
|
|
public void ScriptTraceKinds_FitTheCentralColumns(AuditKind kind)
|
|
{
|
|
// AuditLog.Category / Kind are nvarchar(32) (AuditLogEntityTypeConfiguration).
|
|
Assert.True(kind.ToString().Length <= 32);
|
|
Assert.True(AuditChannel.ScriptTrace.ToString().Length <= 32);
|
|
Assert.Equal($"ScriptTrace.{kind}", AuditFieldBuilders.BuildAction(AuditChannel.ScriptTrace, kind));
|
|
}
|
|
|
|
/// <summary>Verifies that the script trace values are appended after the cluster values so existing ordinals stay stable.</summary>
|
|
[Fact]
|
|
public void ScriptTrace_IsAppendedAfterCluster_SoExistingOrdinalsAreStable()
|
|
{
|
|
Assert.True((int)AuditChannel.ScriptTrace > (int)AuditChannel.Cluster);
|
|
Assert.True((int)AuditKind.RouteCall > (int)AuditKind.ManualFailover);
|
|
}
|
|
}
|