fix(management): ParseDeploymentStatus rejects ordinals — Enum.TryParse accepts "2" as InProgress despite the row-88 names-only contract; same LooksNumeric guard as the audit strict parser (found by the Wave 6 rows-98/99 agent survey)
This commit is contained in:
@@ -1678,6 +1678,27 @@ public class ManagementActorTests : TestKit, IDisposable
|
||||
deployRepo.DidNotReceiveWithAnyArgs().QueryDeploymentListPageAsync(default!, default, default);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("2")]
|
||||
[InlineData("+1")]
|
||||
[InlineData("-1")]
|
||||
public void QueryDeployments_OrdinalStatus_IsRejectedLikeAnyUnknownValue(string status)
|
||||
{
|
||||
// Register row 88 postscript (Wave 6): Enum.TryParse accepts ordinals, so
|
||||
// `--status 2` silently resolved to InProgress despite the documented
|
||||
// names-only contract. Same guard as AuditQueryParamParsers.LooksNumeric.
|
||||
var deployRepo = Substitute.For<IDeploymentManagerRepository>();
|
||||
StubDeploymentPageQuery(deployRepo, (1, 1));
|
||||
_services.AddScoped(_ => deployRepo);
|
||||
|
||||
var actor = CreateActor();
|
||||
actor.Tell(Envelope(new QueryDeploymentsCommand(Status: status), "Deployer"));
|
||||
|
||||
var response = ExpectMsg<ManagementError>(TimeSpan.FromSeconds(5));
|
||||
Assert.Contains("Success", response.Error);
|
||||
deployRepo.DidNotReceiveWithAnyArgs().QueryDeploymentListPageAsync(default!, default, default);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("success")]
|
||||
[InlineData("SUCCESS")]
|
||||
|
||||
Reference in New Issue
Block a user