test: cover repository generator hosts#432
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
Expands the repository source generator to support nested host types by emitting wrapping partial declarations, and rewrites the generator test suite as TinyBDD scenarios that cover more invalid-input branches plus host-shape and emission-success assertions.
Changes:
- Emit containing-type partial wrappers (with indentation and accessibility) so
[GenerateRepository]works on nested types. - Refactor
GenerateSourceto share anAppendTypeDeclarationhelper between the host type and its containers. - Convert
RepositoryGeneratorTeststo TinyBDD[Scenario]tests covering invalid selectors, malformedtypeofarguments, default factory names, host shapes (abstract/sealed/struct), and nested hosts; add a sharedCompilehelper andGeneratorResultrecord that also verifies emit success.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/PatternKit.Generators/Repository/RepositoryGenerator.cs | Emit containing-type wrappers and refactor type-declaration emission into a helper with indentation support. |
| test/PatternKit.Generators.Tests/RepositoryGeneratorTests.cs | Rewrite tests as TinyBDD scenarios; broaden coverage to nested hosts, varied host shapes, malformed attribute args, and emission success. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test Results 12 files 12 suites 9m 53s ⏱️ Results for commit 6a1814b. |
Code Coverage |
🔍 PR Validation ResultsVersion: `` ✅ Validation Steps
📊 ArtifactsDry-run artifacts have been uploaded and will be available for 7 days. This comment was automatically generated by the PR validation workflow. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #432 +/- ##
==========================================
+ Coverage 90.36% 96.14% +5.77%
==========================================
Files 551 551
Lines 44372 44392 +20
Branches 6385 6388 +3
==========================================
+ Hits 40097 42680 +2583
+ Misses 1836 1712 -124
+ Partials 2439 0 -2439
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Validation
Coverage: RepositoryGenerator 99.1%; PatternKit.Generators 95.6% locally.