Problem
The repo has no test project. CI runs dotnet build and dotnet pack but never executes tests. Critical paths are completely unverified:
src/Crypto/SealPipeline.cs — policy JSON construction (BuildPolicyJson), parallel key fetching, native FFI invocation
src/Api/CryptifyClient.cs — chunked upload (Content-Range formatting, token rotation across chunks, init/finalize wiring)
src/Api/PkgClient.cs — JSON parsing of MPK and signing key responses
src/Zip/ZipHelper.cs — file packing
- Recipient/policy edge cases (e.g.
EmailDomain with no @, multiple extras)
Suggested approach
- Add
tests/E4A.PostGuard.Tests/ xUnit project, register in E4A.PostGuard.slnx
- Pure unit tests for
BuildPolicyJson, ZipHelper, recipient builders, exception types
- Integration tests for the API clients using a mock
HttpMessageHandler so the full chunked-upload flow is exercised without a live Cryptify
- Add a
dotnet test --configuration Release step to .github/workflows/build.yml between Build and Pack
Why now
Without any tests, refactors (e.g. swapping byte[] → Stream) and dependency bumps land blind. A baseline unit suite makes future work safer.
Problem
The repo has no test project. CI runs
dotnet buildanddotnet packbut never executes tests. Critical paths are completely unverified:src/Crypto/SealPipeline.cs— policy JSON construction (BuildPolicyJson), parallel key fetching, native FFI invocationsrc/Api/CryptifyClient.cs— chunked upload (Content-Rangeformatting, token rotation across chunks, init/finalize wiring)src/Api/PkgClient.cs— JSON parsing of MPK and signing key responsessrc/Zip/ZipHelper.cs— file packingEmailDomainwith no@, multiple extras)Suggested approach
tests/E4A.PostGuard.Tests/xUnit project, register inE4A.PostGuard.slnxBuildPolicyJson,ZipHelper, recipient builders, exception typesHttpMessageHandlerso the full chunked-upload flow is exercised without a live Cryptifydotnet test --configuration Releasestep to.github/workflows/build.ymlbetween Build and PackWhy now
Without any tests, refactors (e.g. swapping
byte[]→Stream) and dependency bumps land blind. A baseline unit suite makes future work safer.