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:
@@ -4,7 +4,7 @@ using ZB.MOM.WW.ScadaBridge.CLI.Commands;
|
||||
namespace ZB.MOM.WW.ScadaBridge.CLI.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Regression tests for CLI-009 — the design doc defines exit code 2 as "authorization
|
||||
/// Regression tests for the exit-code contract: the design doc defines exit code 2 as "authorization
|
||||
/// failure". The previous implementation keyed exit 2 solely off HTTP 403, so an
|
||||
/// authorization failure the server signalled with an error <c>code</c> of
|
||||
/// <c>UNAUTHORIZED</c>/<c>FORBIDDEN</c> but a different HTTP status was misreported as a
|
||||
@@ -27,12 +27,15 @@ public class ExitCodeTests
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an HTTP 403 response returns exit code 2.</summary>
|
||||
[Fact]
|
||||
public void HandleResponse_Http403_ReturnsTwo()
|
||||
{
|
||||
Assert.Equal(2, HandleQuietly(new ManagementResponse(403, null, "Forbidden", "FORBIDDEN")));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an authorization error code with a status other than 403 still returns exit code 2.</summary>
|
||||
/// <param name="code">The error code returned by the server.</param>
|
||||
[Theory]
|
||||
[InlineData("UNAUTHORIZED")]
|
||||
[InlineData("FORBIDDEN")]
|
||||
@@ -40,16 +43,18 @@ public class ExitCodeTests
|
||||
public void HandleResponse_AuthorizationCode_NonForbiddenStatus_ReturnsTwo(string code)
|
||||
{
|
||||
// The server signalled an authorization failure via the error code but with a
|
||||
// non-403 HTTP status; per the documented exit-code table this is still exit 2.
|
||||
// HTTP status other than 403 status; per the documented exit-code table this is still exit 2.
|
||||
Assert.Equal(2, HandleQuietly(new ManagementResponse(400, null, "Access denied", code)));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a generic error returns exit code 1.</summary>
|
||||
[Fact]
|
||||
public void HandleResponse_GenericError_ReturnsOne()
|
||||
{
|
||||
Assert.Equal(1, HandleQuietly(new ManagementResponse(400, null, "Validation failed", "INVALID_ARGUMENT")));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an authentication failure returns exit code 1.</summary>
|
||||
[Fact]
|
||||
public void HandleResponse_AuthenticationFailure_ReturnsOne()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user