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:
@@ -5,7 +5,7 @@ using MailKit.Net.Smtp;
|
||||
namespace ZB.MOM.WW.ScadaBridge.NotificationService.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// NS-002/NS-003: Tests for the shared SMTP error classification policy. This
|
||||
/// Tests for the shared SMTP error classification policy. This
|
||||
/// policy is correctness-relevant — it decides whether a delivery failure is
|
||||
/// retried (transient) or returned to the caller (permanent) — and is shared
|
||||
/// by the central outbox's <c>EmailNotificationDeliveryAdapter</c>, so it
|
||||
@@ -13,6 +13,8 @@ namespace ZB.MOM.WW.ScadaBridge.NotificationService.Tests;
|
||||
/// </summary>
|
||||
public class SmtpErrorClassifierTests
|
||||
{
|
||||
/// <summary>Verifies that an SMTP 4xx command error is classified as transient.</summary>
|
||||
/// <param name="statusCode">The SMTP status code.</param>
|
||||
[Theory]
|
||||
[InlineData(421)] // service not available
|
||||
[InlineData(450)] // mailbox unavailable (busy)
|
||||
@@ -26,6 +28,8 @@ public class SmtpErrorClassifierTests
|
||||
Assert.Equal(SmtpErrorClass.Transient, SmtpErrorClassifier.Classify(ex, CancellationToken.None));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an SMTP 5xx command error is classified as permanent.</summary>
|
||||
/// <param name="statusCode">The SMTP status code.</param>
|
||||
[Theory]
|
||||
[InlineData(500)] // syntax error
|
||||
[InlineData(550)] // mailbox unavailable (rejected)
|
||||
@@ -39,6 +43,7 @@ public class SmtpErrorClassifierTests
|
||||
Assert.Equal(SmtpErrorClass.Permanent, SmtpErrorClassifier.Classify(ex, CancellationToken.None));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an SMTP command error with an unusual status code is classified as unknown.</summary>
|
||||
[Fact]
|
||||
public void Classify_SmtpCommandWithUnusualCode_IsUnknown()
|
||||
{
|
||||
@@ -49,6 +54,7 @@ public class SmtpErrorClassifierTests
|
||||
Assert.Equal(SmtpErrorClass.Unknown, SmtpErrorClassifier.Classify(ex, CancellationToken.None));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an SMTP protocol exception is classified as transient.</summary>
|
||||
[Fact]
|
||||
public void Classify_SmtpProtocolException_IsTransient()
|
||||
{
|
||||
@@ -57,6 +63,7 @@ public class SmtpErrorClassifierTests
|
||||
SmtpErrorClassifier.Classify(new SmtpProtocolException("protocol error"), CancellationToken.None));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a service-not-connected exception is classified as transient.</summary>
|
||||
[Fact]
|
||||
public void Classify_ServiceNotConnectedException_IsTransient()
|
||||
{
|
||||
@@ -65,6 +72,7 @@ public class SmtpErrorClassifierTests
|
||||
SmtpErrorClassifier.Classify(new ServiceNotConnectedException(), CancellationToken.None));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a socket exception is classified as transient.</summary>
|
||||
[Fact]
|
||||
public void Classify_SocketException_IsTransient()
|
||||
{
|
||||
@@ -73,6 +81,7 @@ public class SmtpErrorClassifierTests
|
||||
SmtpErrorClassifier.Classify(new SocketException(), CancellationToken.None));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a timeout exception is classified as transient.</summary>
|
||||
[Fact]
|
||||
public void Classify_TimeoutException_IsTransient()
|
||||
{
|
||||
@@ -81,6 +90,7 @@ public class SmtpErrorClassifierTests
|
||||
SmtpErrorClassifier.Classify(new TimeoutException(), CancellationToken.None));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a requested cancellation is classified as unknown.</summary>
|
||||
[Fact]
|
||||
public void Classify_RequestedCancellation_IsUnknown()
|
||||
{
|
||||
@@ -92,6 +102,7 @@ public class SmtpErrorClassifierTests
|
||||
SmtpErrorClassifier.Classify(new OperationCanceledException(), cts.Token));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an operation cancellation without a requested cancellation is classified as unknown.</summary>
|
||||
[Fact]
|
||||
public void Classify_OperationCanceledWithoutRequestedCancellation_IsUnknown()
|
||||
{
|
||||
@@ -101,6 +112,7 @@ public class SmtpErrorClassifierTests
|
||||
SmtpErrorClassifier.Classify(new OperationCanceledException(), CancellationToken.None));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an unrecognised exception is classified as unknown.</summary>
|
||||
[Fact]
|
||||
public void Classify_UnrecognisedException_IsUnknown()
|
||||
{
|
||||
@@ -109,6 +121,9 @@ public class SmtpErrorClassifierTests
|
||||
SmtpErrorClassifier.Classify(new InvalidOperationException("bad credential triple"), CancellationToken.None));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the transient check matches the classification of the status code.</summary>
|
||||
/// <param name="statusCode">The SMTP status code.</param>
|
||||
/// <param name="expectedTransient">Whether the status code is expected to be transient.</param>
|
||||
[Theory]
|
||||
[InlineData(450, true)]
|
||||
[InlineData(550, false)]
|
||||
@@ -121,6 +136,7 @@ public class SmtpErrorClassifierTests
|
||||
Assert.Equal(expectedTransient, SmtpErrorClassifier.IsTransient(ex, CancellationToken.None));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a requested cancellation is not transient.</summary>
|
||||
[Fact]
|
||||
public void IsTransient_RequestedCancellation_IsFalse()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user