docs(plan-1): note ThrowsAny for tamper test (.NET 9 AesGcm behavior)

This commit is contained in:
Claude
2026-08-28 12:08:43 +00:00
parent caa1e6e834
commit 37c35581ec

View File

@@ -1490,7 +1490,9 @@ public class EncryptionServiceTests
var bytes = Convert.FromBase64String(wire);
bytes[^1] ^= 0x01; // flip a bit in the tag
var tampered = Convert.ToBase64String(bytes);
Assert.Throws<CryptographicException>(() => svc.Decrypt(tampered));
// ThrowsAny (not Throws) because .NET 9 throws the more specific
// AuthenticationTagMismatchException subclass on tamper.
Assert.ThrowsAny<CryptographicException>(() => svc.Decrypt(tampered));
}
[Fact]