test(generators): cover identity map and service layer#442
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
This PR pushes coverage of the IdentityMap and ServiceLayerOperation source generators by (a) teaching them to preserve nested containing-type partial wrappers, and (b) expanding TinyBDD scenarios to exercise emit success, defaults, malformed type arguments, nested hosts, and additional invalid handler/rule signature branches.
Changes:
- Generators now emit containing-type partial wrappers (with appropriate accessibility/modifiers) around the generated factory, via new
GetContainingTypes/AppendTypeDeclarationhelpers. - Generator tests add scenarios for default names + host shapes (abstract/sealed/struct), nested hosts (including
private protected/protected internal), malformedtypeofarguments, and more invalid handler/rule shapes; tests now also assertCompilation.Emitsuccess. GeneratorResultrecord is extended withEmitSuccessandEmitDiagnostics.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/PatternKit.Generators/IdentityMap/IdentityMapGenerator.cs | Emit containing-type partial wrappers and refactor type-declaration emission into helpers. |
| src/PatternKit.Generators/ServiceLayer/ServiceLayerOperationGenerator.cs | Same nested-wrapper emission for ServiceLayerOperation generator, with computed indents for member/body. |
| test/PatternKit.Generators.Tests/IdentityMapGeneratorTests.cs | New scenarios for host shapes, nested hosts, malformed type args, extra invalid selectors, and emit verification. |
| test/PatternKit.Generators.Tests/ServiceLayerGeneratorTests.cs | New scenarios for host shapes, nested hosts, malformed type args, extra invalid handler/rule signatures, and emit verification. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test Results 12 files 12 suites 11m 3s ⏱️ Results for commit 9fabe58. |
Code Coverage |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #442 +/- ##
==========================================
+ Coverage 91.34% 96.66% +5.32%
==========================================
Files 551 551
Lines 44820 44860 +40
Branches 6458 6464 +6
==========================================
+ Hits 40941 43366 +2425
+ Misses 1589 1494 -95
+ Partials 2290 0 -2290
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:
|
🔍 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. |
Summary
Validation
Refs #413