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:
@@ -18,7 +18,7 @@ public class NotificationForwarderTests : TestKit
|
||||
|
||||
/// <summary>
|
||||
/// Builds a buffered notification S&F message whose payload matches the shape
|
||||
/// produced by the site <c>Notify.Send</c> enqueue path (Task 19): a serialized
|
||||
/// produced by the site <c>Notify.Send</c> enqueue path: a serialized
|
||||
/// <see cref="NotificationSubmit"/> carrying a script-generated
|
||||
/// <see cref="NotificationSubmit.NotificationId"/>. The S&F message
|
||||
/// <see cref="StoreAndForwardMessage.Id"/> equals that same id.
|
||||
@@ -50,6 +50,8 @@ public class NotificationForwarderTests : TestKit
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>Verifies that delivery forwards a notification submit to the central target and returns true when it is accepted.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Deliver_ForwardsNotificationSubmitToCentralTarget_AndReturnsTrueOnAccept()
|
||||
{
|
||||
@@ -80,10 +82,12 @@ public class NotificationForwarderTests : TestKit
|
||||
Assert.True(await deliverTask);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that delivery preserves the origin execution id from the buffered payload.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Deliver_PreservesOriginExecutionId_FromBufferedPayload()
|
||||
{
|
||||
// Audit Log #23: the buffered payload's OriginExecutionId is the per-run
|
||||
// The buffered payload's OriginExecutionId is the per-run
|
||||
// id stamped at Notify.Send time. The forwarder re-stamps only the four
|
||||
// fields it authoritatively owns (NotificationId, ListName, SourceSiteId,
|
||||
// SourceInstanceId) via the `with` expression — OriginExecutionId is
|
||||
@@ -107,6 +111,8 @@ public class NotificationForwarderTests : TestKit
|
||||
Assert.True(await deliverTask);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that delivery falls back to the target when the payload's list name is empty.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Deliver_FallsBackToTarget_WhenPayloadListNameIsEmpty()
|
||||
{
|
||||
@@ -143,6 +149,8 @@ public class NotificationForwarderTests : TestKit
|
||||
Assert.True(await deliverTask);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that delivery throws a transient error when the acknowledgement is not accepted.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Deliver_ThrowsTransient_WhenAckIsNotAccepted()
|
||||
{
|
||||
@@ -161,6 +169,8 @@ public class NotificationForwarderTests : TestKit
|
||||
await Assert.ThrowsAnyAsync<Exception>(() => deliverTask);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that delivery throws a transient error when no reply arrives within the timeout.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Deliver_ThrowsTransient_WhenNoReplyWithinTimeout()
|
||||
{
|
||||
@@ -173,6 +183,8 @@ public class NotificationForwarderTests : TestKit
|
||||
await Assert.ThrowsAnyAsync<Exception>(() => forwarder.DeliverAsync(BufferedNotification()));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that delivery uses a stable notification id across retries of the same message.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Deliver_UsesStableNotificationId_AcrossRetriesOfSameMessage()
|
||||
{
|
||||
@@ -198,10 +210,12 @@ public class NotificationForwarderTests : TestKit
|
||||
Assert.Equal("stable-msg-id", submit1.NotificationId);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a corrupt JSON payload returns false, is parked for forensics and is not forwarded.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Deliver_CorruptJsonPayload_ReturnsFalse_ParksForForensics_AndDoesNotForward()
|
||||
{
|
||||
// Supersedes StoreAndForward-018 (discard-on-corrupt). Returning false is the
|
||||
// Supersedes the earlier discard-on-corrupt behavior. Returning false is the
|
||||
// handler contract's permanent-failure signal: the engine parks the row, which
|
||||
// preserves the payload for operator forensics. Retrying a corrupt payload is
|
||||
// pointless; deleting it silently (and reporting Delivered) loses data with no
|
||||
@@ -226,12 +240,14 @@ public class NotificationForwarderTests : TestKit
|
||||
centralProbe.ExpectNoMsg(TimeSpan.FromMilliseconds(200));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a payload that deserializes to null returns false, is parked for forensics and is not forwarded.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Deliver_NullDeserializedPayload_ReturnsFalse_ParksForForensics_AndDoesNotForward()
|
||||
{
|
||||
// The companion case to corrupt JSON: the payload is valid JSON but
|
||||
// deserialises to null (e.g. "null"). Same treatment — park (return false)
|
||||
// rather than silently discard-as-delivered. Supersedes StoreAndForward-018.
|
||||
// rather than silently discard-as-delivered. Supersedes the earlier discard-on-corrupt behavior.
|
||||
var centralProbe = CreateTestProbe();
|
||||
var forwarder = new NotificationForwarder(
|
||||
centralProbe.Ref, "site-7", ForwardTimeout);
|
||||
|
||||
Reference in New Issue
Block a user