Skip to content

Features/unit tests - #28

Merged
RicardoZambon merged 8 commits into
mainfrom
features/unit-tests
Sep 19, 2026
Merged

RicardoZambon merged 8 commits into
mainfrom
features/unit-tests

Conversation

@RicardoZambon

Copy link
Copy Markdown
Owner

No description provided.

Ricardo Zambon and others added 5 commits September 19, 2026 00:08
Creates ZWebAPI.UnitTests next to the library and registers it in the
solution. Covers the exporter stack: column metadata resolution, value
formatting, the list result envelope, the row-limit exception and every
format exporter (CSV, XLSX, PDF, XML, MHTML) including the empty, null
and type-mismatch paths.

The library exposes its internals to the test assembly so the internal
format exporters can be driven directly instead of only through the
public dispatcher.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Adds tests for the filtering, paging and catalog helpers, the list and
export materializers, the summary-parameter filter reader (including the
nullable and explicit-null filter values fixed by the previous commit),
the audit entry and entity entry helpers, the parameter and list models
and the current-user provider.

Marks DependencyInjectionExtensions as excluded from code coverage, the
way ZDatabase already does, since it only registers services.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Exercises the service history lifecycle end to end: the action-method
stack lookup that names a new service history, the permission check, the
missing-service-history guard when auditing an operation, the two
entity-not-found guards when listing operations, the table/entity match
that decides whether operations are returned at all, and the projected
and paginated listings.

Exposes the test assembly internals to NSubstitute's dynamic proxy
assembly so the internal entity fakes can be used as generic arguments
of the substituted repositories.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Adding the test project through the CLI also introduced x64 and x86
solution platforms that nothing builds for.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Ship ZWebAPI against the current .NET LTS without dropping consumers
still on .NET 8 or .NET 9. The library source needed no changes.

- Add a root Directory.Build.props holding the shared target framework
  list and the EF Core floor for each one, matching ZDatabase and
  ZSecurity.
- Raise the ZDatabase floor to 1.6.0 and the ZSecurity floor to 1.4.0,
  the first versions of each that ship net8.0 and net10.0 assets. A
  net8.0 leg cannot restore against the older, net9.0-only packages.
- Install all three SDKs in CI, and actually run the test suite there:
  the workflow had no test step because the repository had no tests.

The suite added in the preceding commits passes unchanged on all three
target frameworks, which is what establishes that the upgrade altered no
behaviour.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@RicardoZambon RicardoZambon self-assigned this Sep 19, 2026
Resolves two conflicts:

- .github/workflows/release.yml: main migrated to the 5-job Trusted
  Publishing pipeline (#26), which already runs restore, build and test
  and validates pull requests. Took main's pipeline wholesale and
  re-applied only the multi-SDK DOTNET_VERSION list, dropping the
  restore/build/test steps this branch had added to the old workflow.
- ZWebAPI/ZWebAPI.csproj: kept main's added package metadata and the
  corrected repository URLs, and re-applied the multi-targeting changes
  on top, raising the sibling floors to the versions that ship net8.0
  and net10.0 assets.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Ricardo Zambon and others added 2 commits September 19, 2026 16:26
BatchUpdateModel and RelationshipUpdateModel arrived on main while this
branch was open. Cover both to the same standard as the other models,
including the empty-batch and same-identifier-on-both-sides cases and
RelationshipUpdateModel's non-null defaults.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Four exporter sources were saved in a single-byte codepage with no BOM.
When a .cs file is not valid UTF-8 and carries no BOM, Roslyn falls back
to the platform default codepage: Windows-1252 on a developer machine,
UTF-8 on a Linux runner. The same source therefore compiled to different
string literals depending on where it was built.

The practical effect is that every package built by the Linux release
runner shipped the Boolean export value as "N�o" instead of "Não",
in both the CSV/XML/MHTML formatter and the XLSX writer. It went
unnoticed because the repository had no tests; the new suite reproduces
it the first time it runs on CI rather than on Windows.

Converts the two affected string literals (0xE3 -> U+00E3) and three em
dashes in XML documentation (0x97 -> U+2014), and adds a UTF-8 BOM to
all four files so the encoding is explicit on every platform.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@RicardoZambon
RicardoZambon merged commit d1cf8d7 into main Sep 19, 2026
6 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.14.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant