docs+ui: backfill XML doc comments and finish dashboard layout pass
Adds missing <summary>/<param> XML docs across 99 server, worker, and test files so CommentChecker reports zero issues (TreatWarningsAsErrors needs the analyzer clean). Bundles in WIP dashboard work: NavSection extraction, MainLayout/site.css/js styling alignment, and DashboardOptions/Auth tweaks.
This commit is contained in:
@@ -12,6 +12,7 @@ namespace ZB.MOM.WW.MxGateway.Worker.Tests.MxAccess;
|
||||
/// </summary>
|
||||
public sealed class AlarmCommandHandlerTests
|
||||
{
|
||||
/// <summary>Verifies that subscribe creates a consumer and forwards the subscription when not yet subscribed.</summary>
|
||||
[Fact]
|
||||
public void Subscribe_WhenNotYetSubscribed_CreatesConsumerAndCallsSubscribe()
|
||||
{
|
||||
@@ -26,6 +27,7 @@ public sealed class AlarmCommandHandlerTests
|
||||
Assert.Equal(@"\\HOST\Galaxy!Area", consumer.LastSubscription);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that subscribe throws when already subscribed.</summary>
|
||||
[Fact]
|
||||
public void Subscribe_WhenAlreadySubscribed_Throws()
|
||||
{
|
||||
@@ -67,6 +69,7 @@ public sealed class AlarmCommandHandlerTests
|
||||
Assert.True(consumer.Disposed);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that unsubscribe disposes consumer and clears state when subscribed.</summary>
|
||||
[Fact]
|
||||
public void Unsubscribe_WhenSubscribed_DisposesConsumerAndClearsState()
|
||||
{
|
||||
@@ -82,6 +85,7 @@ public sealed class AlarmCommandHandlerTests
|
||||
Assert.True(consumer.Disposed);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that unsubscribe is a no-op when not yet subscribed.</summary>
|
||||
[Fact]
|
||||
public void Unsubscribe_WithoutPriorSubscribe_IsNoop()
|
||||
{
|
||||
@@ -92,6 +96,7 @@ public sealed class AlarmCommandHandlerTests
|
||||
Assert.False(handler.IsSubscribed);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that acknowledge forwards to consumer with full operator identity when subscribed.</summary>
|
||||
[Fact]
|
||||
public void Acknowledge_WhenSubscribed_ForwardsToConsumerWithFullOperatorIdentity()
|
||||
{
|
||||
@@ -109,6 +114,7 @@ public sealed class AlarmCommandHandlerTests
|
||||
Assert.Equal("u", consumer.LastAckOperatorName);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that acknowledge throws invalid operation when called before subscribe.</summary>
|
||||
[Fact]
|
||||
public void Acknowledge_BeforeSubscribe_ThrowsInvalidOperation()
|
||||
{
|
||||
@@ -120,6 +126,7 @@ public sealed class AlarmCommandHandlerTests
|
||||
() => handler.Acknowledge(Guid.Empty, "", "", "", "", ""));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that query active returns mapped proto snapshots when consumer has alarms.</summary>
|
||||
[Fact]
|
||||
public void QueryActive_WhenConsumerHasAlarms_ReturnsMappedProtoSnapshots()
|
||||
{
|
||||
@@ -151,6 +158,7 @@ public sealed class AlarmCommandHandlerTests
|
||||
Assert.Equal(AlarmConditionState.Active, snapshots[0].CurrentState);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that query active filters by prefix when prefix is provided.</summary>
|
||||
[Fact]
|
||||
public void QueryActive_WithPrefix_FiltersByPrefix()
|
||||
{
|
||||
@@ -173,6 +181,7 @@ public sealed class AlarmCommandHandlerTests
|
||||
Assert.Equal("Galaxy!AreaA.Tag1", filtered[0].AlarmFullReference);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that dispose unsubscribes and disposes consumer when subscribed.</summary>
|
||||
[Fact]
|
||||
public void Dispose_WhenSubscribed_UnsubscribesAndDisposesConsumer()
|
||||
{
|
||||
@@ -281,18 +290,28 @@ public sealed class AlarmCommandHandlerTests
|
||||
private sealed class FakeConsumer : IMxAccessAlarmConsumer
|
||||
{
|
||||
#pragma warning disable CS0067 // Event never invoked — fake; AlarmCommandHandler tests don't drive transitions.
|
||||
/// <summary>Emitted when an alarm state transition occurs.</summary>
|
||||
public event EventHandler<MxAlarmTransitionEvent>? AlarmTransitionEmitted;
|
||||
#pragma warning restore CS0067
|
||||
|
||||
/// <summary>Gets the last subscription request.</summary>
|
||||
public string? LastSubscription { get; private set; }
|
||||
/// <summary>Gets the last acknowledged alarm GUID.</summary>
|
||||
public Guid LastAckGuid { get; private set; }
|
||||
/// <summary>Gets the last acknowledged operator name.</summary>
|
||||
public string? LastAckOperatorName { get; private set; }
|
||||
/// <summary>Gets or sets the return value for acknowledge operations.</summary>
|
||||
public int AcknowledgeReturn { get; set; }
|
||||
/// <summary>Gets or sets the snapshot result to return.</summary>
|
||||
public IReadOnlyList<MxAlarmSnapshotRecord> SnapshotResult { get; set; } =
|
||||
Array.Empty<MxAlarmSnapshotRecord>();
|
||||
/// <summary>Gets or sets a value indicating whether to throw on subscribe.</summary>
|
||||
public bool ThrowOnSubscribe { get; set; }
|
||||
/// <summary>Gets a value indicating whether the consumer has been disposed.</summary>
|
||||
public bool Disposed { get; private set; }
|
||||
|
||||
/// <summary>Subscribes to alarms with the given subscription string.</summary>
|
||||
/// <param name="subscription">The subscription reference.</param>
|
||||
public void Subscribe(string subscription)
|
||||
{
|
||||
LastSubscription = subscription;
|
||||
@@ -302,6 +321,13 @@ public sealed class AlarmCommandHandlerTests
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Acknowledges an alarm by GUID.</summary>
|
||||
/// <param name="alarmGuid">The alarm GUID.</param>
|
||||
/// <param name="ackComment">The acknowledgment comment.</param>
|
||||
/// <param name="ackOperatorName">The operator name.</param>
|
||||
/// <param name="ackOperatorNode">The operator node.</param>
|
||||
/// <param name="ackOperatorDomain">The operator domain.</param>
|
||||
/// <param name="ackOperatorFullName">The operator full name.</param>
|
||||
public int AcknowledgeByGuid(
|
||||
Guid alarmGuid, string ackComment, string ackOperatorName,
|
||||
string ackOperatorNode, string ackOperatorDomain, string ackOperatorFullName)
|
||||
@@ -311,6 +337,15 @@ public sealed class AlarmCommandHandlerTests
|
||||
return AcknowledgeReturn;
|
||||
}
|
||||
|
||||
/// <summary>Acknowledges an alarm by name.</summary>
|
||||
/// <param name="alarmName">The alarm name.</param>
|
||||
/// <param name="providerName">The provider name.</param>
|
||||
/// <param name="groupName">The alarm group name.</param>
|
||||
/// <param name="ackComment">The acknowledgment comment.</param>
|
||||
/// <param name="ackOperatorName">The operator name.</param>
|
||||
/// <param name="ackOperatorNode">The operator node.</param>
|
||||
/// <param name="ackOperatorDomain">The operator domain.</param>
|
||||
/// <param name="ackOperatorFullName">The operator full name.</param>
|
||||
public int AcknowledgeByName(
|
||||
string alarmName, string providerName, string groupName,
|
||||
string ackComment, string ackOperatorName, string ackOperatorNode,
|
||||
@@ -321,17 +356,22 @@ public sealed class AlarmCommandHandlerTests
|
||||
return AcknowledgeReturn;
|
||||
}
|
||||
|
||||
/// <summary>Gets the last acknowledge-by-name parameters.</summary>
|
||||
public (string Name, string Provider, string Group)? LastAckByNameTuple { get; private set; }
|
||||
|
||||
/// <summary>Returns a snapshot of active alarms.</summary>
|
||||
public IReadOnlyList<MxAlarmSnapshotRecord> SnapshotActiveAlarms() => SnapshotResult;
|
||||
|
||||
/// <summary>Gets the number of times polled.</summary>
|
||||
public int PollCount { get; private set; }
|
||||
|
||||
/// <summary>Polls once for alarm updates.</summary>
|
||||
public void PollOnce()
|
||||
{
|
||||
PollCount++;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
Disposed = true;
|
||||
|
||||
Reference in New Issue
Block a user