docs(tests): fix CommentChecker findings across tests/ — 13,392 → 0 (repo-wide scan clean)
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.
This commit is contained in:
+21
-1
@@ -8,7 +8,7 @@ using ZB.MOM.WW.ScadaBridge.TestSupport;
|
||||
namespace ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// StoreAndForward-013: tests for the <see cref="ParkedMessageHandlerActor"/> actor
|
||||
/// Tests for the <see cref="ParkedMessageHandlerActor"/> actor
|
||||
/// bridge — the Query/Retry/Discard request-to-response mapping and the
|
||||
/// <c>ExtractMethodName</c> payload-JSON parsing (including the malformed-JSON branch).
|
||||
/// </summary>
|
||||
@@ -18,6 +18,7 @@ public class ParkedMessageHandlerActorTests : TestKit, IAsyncLifetime, IDisposab
|
||||
private readonly StoreAndForwardStorage _storage;
|
||||
private readonly StoreAndForwardService _service;
|
||||
|
||||
/// <summary>Initializes a new instance of the <c>ParkedMessageHandlerActorTests</c> class.</summary>
|
||||
public ParkedMessageHandlerActorTests()
|
||||
{
|
||||
_localDb = TestLocalDb.CreateTemp("ActorTests");
|
||||
@@ -35,10 +36,15 @@ public class ParkedMessageHandlerActorTests : TestKit, IAsyncLifetime, IDisposab
|
||||
_storage, options, NullLogger<StoreAndForwardService>.Instance);
|
||||
}
|
||||
|
||||
/// <summary>Initializes the storage before the tests run.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
public async Task InitializeAsync() => await _storage.InitializeAsync();
|
||||
|
||||
/// <summary>Does nothing; storage is released in <c>Dispose</c>.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
public Task DisposeAsync() => Task.CompletedTask;
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
@@ -60,6 +66,8 @@ public class ParkedMessageHandlerActorTests : TestKit, IAsyncLifetime, IDisposab
|
||||
return result.MessageId;
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a query returns the parked entries with the method name extracted from each payload.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Query_ReturnsParkedEntries_WithExtractedMethodName()
|
||||
{
|
||||
@@ -78,6 +86,8 @@ public class ParkedMessageHandlerActorTests : TestKit, IAsyncLifetime, IDisposab
|
||||
Assert.Equal(StoreAndForwardCategory.ExternalSystem, response.Messages[0].Category);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a notification payload uses its subject as the method name.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Query_NotificationPayload_UsesSubjectAsMethodName()
|
||||
{
|
||||
@@ -92,6 +102,8 @@ public class ParkedMessageHandlerActorTests : TestKit, IAsyncLifetime, IDisposab
|
||||
Assert.Equal("Tank overflow", response.Messages[0].MethodName);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a malformed JSON payload falls back to the category name.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Query_MalformedJsonPayload_FallsBackToCategoryName()
|
||||
{
|
||||
@@ -106,6 +118,8 @@ public class ParkedMessageHandlerActorTests : TestKit, IAsyncLifetime, IDisposab
|
||||
Assert.Equal(StoreAndForwardCategory.CachedDbWrite.ToString(), response.Messages[0].MethodName);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a payload with neither a method name nor a subject falls back to the category name.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Query_PayloadWithoutMethodNameOrSubject_FallsBackToCategoryName()
|
||||
{
|
||||
@@ -118,6 +132,8 @@ public class ParkedMessageHandlerActorTests : TestKit, IAsyncLifetime, IDisposab
|
||||
Assert.Equal(StoreAndForwardCategory.ExternalSystem.ToString(), response.Messages[0].MethodName);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that retrying a parked message returns success.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Retry_ParkedMessage_ReturnsSuccess()
|
||||
{
|
||||
@@ -135,6 +151,7 @@ public class ParkedMessageHandlerActorTests : TestKit, IAsyncLifetime, IDisposab
|
||||
Assert.Equal(StoreAndForwardMessageStatus.Pending, msg!.Status);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that retrying an unknown message returns a failure with an explanatory message.</summary>
|
||||
[Fact]
|
||||
public void Retry_UnknownMessage_ReturnsFailureWithMessage()
|
||||
{
|
||||
@@ -147,6 +164,8 @@ public class ParkedMessageHandlerActorTests : TestKit, IAsyncLifetime, IDisposab
|
||||
Assert.NotNull(response.ErrorMessage);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that discarding a parked message returns success and removes the message.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Discard_ParkedMessage_ReturnsSuccessAndRemovesMessage()
|
||||
{
|
||||
@@ -163,6 +182,7 @@ public class ParkedMessageHandlerActorTests : TestKit, IAsyncLifetime, IDisposab
|
||||
Assert.Null(msg);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that discarding an unknown message returns a failure with an explanatory message.</summary>
|
||||
[Fact]
|
||||
public void Discard_UnknownMessage_ReturnsFailureWithMessage()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user