test(generators): cover event notification and envelope#439
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
Hardens the Event Notification and Message Envelope source generators to support nested host types (and a wider range of host shapes/accessibilities), and rewrites both generators' test suites onto TinyBDD xUnit Theory-driven scenarios that cover diagnostics, defaults, malformed inputs, and nested-host emission.
Changes:
- Generators now emit the containing partial-type wrappers via
GetContainingTypes+AppendTypeDeclaration, preserving accessibility (static/abstract/sealed/private protected/protected internal) andstruct/classkind for both the host and its enclosing types. - Message Envelope tests are migrated to a
TinyBddXunitBasepartial class with a sharedCompilehelper andGeneratorResult/GeneratedSourcerecords, mirroring the existing Event Notification test infrastructure. - Diagnostic, default-name, host-shape, nested-host, and malformed-
typeof(...)argument scenarios are added for both generators (PKEN001–004, PKME001–004).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/PatternKit.Generators/Messaging/MessageEnvelopeGenerator.cs | Emit containing-type wrappers and richer accessibility/modifier handling around the envelope/context factory body. |
| src/PatternKit.Generators/EventNotification/EventNotificationGenerator.cs | Same nested-host wrapping/indentation overhaul for the notification factory emission. |
| test/PatternKit.Generators.Tests/MessageEnvelopeGeneratorTests.cs | Convert to TinyBDD scenarios with Theory diagnostic coverage and new default/nested/malformed scenarios. |
| test/PatternKit.Generators.Tests/EventNotificationGeneratorTests.cs | Replace multi-compile diagnostic test with per-InlineData scenarios; add defaults, nested-host, and malformed-typeof coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test Results 12 files 12 suites 11m 17s ⏱️ Results for commit 4805b51. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #439 +/- ##
==========================================
+ Coverage 90.96% 96.52% +5.56%
==========================================
Files 551 551
Lines 44627 44723 +96
Branches 6426 6442 +16
==========================================
+ Hits 40595 43171 +2576
+ Misses 1682 1552 -130
+ Partials 2350 0 -2350
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. |
Code Coverage |
Summary
Validation
Refs #413