Skip to content

Add baseline unit coverage and Verify-based public API approvals; wire CI to solution tests#211

Merged
mauroservienti merged 4 commits intomasterfrom
copilot/add-unit-tests-and-ci
Feb 23, 2026
Merged

Add baseline unit coverage and Verify-based public API approvals; wire CI to solution tests#211
mauroservienti merged 4 commits intomasterfrom
copilot/add-unit-tests-and-ci

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

This PR adds initial automated coverage for the testing factories and introduces approval testing for the package public surface using PublicApiGenerator + Verify. CI is aligned to build/test the solution explicitly so the new test project is always exercised.

  • Test coverage foundation

    • Added ServiceComposer.AspNetCore.Testing.Tests (xUnit) and included it in the solution.
    • Added focused tests for:
      • SelfContainedWebApplicationFactoryWithHost<TEntryPoint>
      • SelfContainedWebApplicationFactoryWithWebHost<TEntryPoint>
      • WebApplicationFactoryWithWebHost<TStartup>
    • Coverage targets request handling and builder customization hooks.
  • Public API approval testing

    • Replaced custom reflection/string-comparison API snapshot logic.
    • Added package-based approval flow:
      • PublicApiGenerator for API extraction
      • Verify.Xunit for snapshot verification
    • Switched from custom PublicApi.approved.txt to Verify .verified.txt baseline artifact.
  • CI execution scope

    • Updated workflow commands to target src/ServiceComposer.AspNetCore.Testing.sln for both build and test.
    • Ensures test project participation is deterministic in CI.
[Fact]
public Task Public_api_is_approved()
{
    var publicApi = ApiGenerator.GeneratePublicApi(typeof(WebApplicationFactoryWithWebHost<>).Assembly);
    return Verifier.Verify(publicApi);
}

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] Add basic unit tests and API approval tests with CI configuration Add baseline unit coverage and public API approval tests; wire CI to run solution tests Feb 23, 2026
Copilot AI requested a review from mauroservienti February 23, 2026 11:10
Copilot AI changed the title Add baseline unit coverage and public API approval tests; wire CI to run solution tests Replace custom API snapshot logic with PublicApiGenerator + Verify approvals Feb 23, 2026
Copilot AI and others added 4 commits February 23, 2026 12:27
Co-authored-by: mauroservienti <1325611+mauroservienti@users.noreply.github.com>
Co-authored-by: mauroservienti <1325611+mauroservienti@users.noreply.github.com>
Co-authored-by: mauroservienti <1325611+mauroservienti@users.noreply.github.com>
Co-authored-by: mauroservienti <1325611+mauroservienti@users.noreply.github.com>
@mauroservienti mauroservienti force-pushed the copilot/add-unit-tests-and-ci branch from ff44f01 to 4e88e71 Compare February 23, 2026 11:27
@mauroservienti mauroservienti marked this pull request as ready for review February 23, 2026 11:27
Copilot AI changed the title Replace custom API snapshot logic with PublicApiGenerator + Verify approvals Add baseline unit coverage and Verify-based public API approvals; wire CI to solution tests Feb 23, 2026
Copilot AI requested a review from mauroservienti February 23, 2026 11:29
@mauroservienti mauroservienti merged commit 9e46d9e into master Feb 23, 2026
5 checks passed
@mauroservienti mauroservienti deleted the copilot/add-unit-tests-and-ci branch February 23, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants