Skip to content

test(generators): cover event notification and envelope#439

Merged
JerrettDavis merged 1 commit into
mainfrom
test/event-notification-envelope-generator-coverage-413
May 30, 2026
Merged

test(generators): cover event notification and envelope#439
JerrettDavis merged 1 commit into
mainfrom
test/event-notification-envelope-generator-coverage-413

Conversation

@JerrettDavis

Copy link
Copy Markdown
Owner

Summary

  • harden Event Notification and Message Envelope source generation for nested/typed host shapes
  • convert Message Envelope generator tests onto TinyBDD xUnit scenarios
  • expand diagnostics, defaults, malformed argument, and nested host coverage

Validation

  • dotnet format PatternKit.slnx --verify-no-changes --verbosity minimal
  • dotnet test test\PatternKit.Generators.Tests\PatternKit.Generators.Tests.csproj --configuration Release --no-restore --no-build -p:TestTfmsInParallel=false --logger "console;verbosity=minimal"
  • local coverage pass: PatternKit.Generators 96.5%, EventNotificationGenerator 99.3%, MessageEnvelopeGenerator 97.7%

Refs #413

Copilot AI review requested due to automatic review settings May 30, 2026 00:58
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) and struct/class kind for both the host and its enclosing types.
  • Message Envelope tests are migrated to a TinyBddXunitBase partial class with a shared Compile helper and GeneratorResult/GeneratedSource records, 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.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

    12 files      12 suites   11m 17s ⏱️
 3 766 tests  3 766 ✅ 0 💤 0 ❌
11 633 runs  11 633 ✅ 0 💤 0 ❌

Results for commit 4805b51.

@codecov

codecov Bot commented May 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.85057% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.52%. Comparing base (667db78) to head (4805b51).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...t.Generators/Messaging/MessageEnvelopeGenerator.cs 98.00% 1 Missing ⚠️
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     
Flag Coverage Δ
unittests 96.52% <98.85%> (+5.56%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 PR Validation Results

Version: ``

✅ Validation Steps

  • Build solution
  • Run tests
  • Build documentation
  • Dry-run NuGet packaging

📊 Artifacts

Dry-run artifacts have been uploaded and will be available for 7 days.


This comment was automatically generated by the PR validation workflow.

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Summary
  Generated on: 05/30/2026 - 01:07:22
  Coverage date: 05/30/2026 - 01:04:54 - 05/30/2026 - 01:07:09
  Parser: MultiReport (12x Cobertura)
  Assemblies: 5
  Classes: 1616
  Files: 551
  Line coverage: 96.3%
  Covered lines: 43082
  Uncovered lines: 1641
  Coverable lines: 44723
  Total lines: 96318
  Branch coverage: 80.8% (13274 of 16422)
  Covered branches: 13274
  Total branches: 16422
  Method coverage: 96.6% (8416 of 8707)
  Full method coverage: 89.9% (7828 of 8707)
  Covered methods: 8416
  Fully covered methods: 7828
  Total methods: 8707

PatternKit.Core                                                                                                     95.4%
  PatternKit.Application.ActivityTracking.ActivityGateState                                                          100%
  PatternKit.Application.ActivityTracking.ActivityLease                                                              100%
  PatternKit.Application.ActivityTracking.ActivityRecord                                                             100%
  PatternKit.Application.ActivityTracking.ActivityTracker                                                            100%
  PatternKit.Application.Aggregates.AggregateCommandHandler<T1, T2, T3>                                              100%
  PatternKit.Application.Aggregates.AggregateCommandResult<T>                                                        100%
  PatternKit.Application.Aggregates.AggregateRoot<T1, T2>                                                            100%
  PatternKit.Application.AntiCorruption.AntiCorruptionLayer<T1, T2>                                                 90.4%
  PatternKit.Application.AntiCorruption.AntiCorruptionResult<T>                                                      100%
  PatternKit.Application.AuditLog.AuditLogAppendResult<T>                                                           85.7%
  PatternKit.Application.AuditLog.InMemoryAuditLog<T1, T2>                                                          95.4%
  PatternKit.Application.BoundedContexts.BoundedContextAdapter                                                       100%
  PatternKit.Application.BoundedContexts.BoundedContextCapability                                                   83.3%
  PatternKit.Application.BoundedContexts.BoundedContextDescriptor                                                   95.4%
  PatternKit.Application.ContextMaps.ContextMapDescriptor                                                           96.8%
  PatternKit.Application.ContextMaps.ContextMapRelationship                                                          100%
  PatternKit.Application.DataMapping.DataMapper<T1, T2>                                                             94.6%
  PatternKit.Application.DataMapping.DataMapperError                                                                  90%
  PatternKit.Application.DataMapping.DataMapperResult<T>                                                            84.6%
  PatternKit.Application.DomainEvents.DomainEventDispatcher<T>                                                      95.4%
  PatternKit.Application.DomainEvents.DomainEventDispatchResult                                                      100%
  PatternKit.Application.DomainServices.DomainServiceOperation<T1, T2>                                               100%
  PatternKit.Application.DomainServices.DomainServiceRegistry<T1, T2>                                                100%
  PatternKit.Application.EventSourcing.EventStoreAppendResult                                                        100%
  PatternKit.Application.EventSourcing.InMemoryEventStore<T1, T2>                                                   97.9%
  PatternKit.Application.EventSourcing.StoredEvent<T1, T2>                                                            80%
  PatternKit.Application.FeatureToggles.FeatureToggleDecision                                                       87.5%
  PatternKit.Application.FeatureToggles.FeatureToggleRule<T>                                                         100%
  PatternKit.Application.FeatureToggles.FeatureToggleSet<T>                                                         96.9%
  PatternKit.Application.IdentityMap.IdentityMap<T1, T2>                                                             100%
  PatternKit.Application.IdentityMap.IdentityMapResult<T>                                                           92.8%
  PatternKit.Application.MaterializedViews.MaterializedView<T1, T2>                                                 98.4%
  PatternKit.Application.Repository.InMemoryRepository<T1, T2>                                                      92.8%
  PatternKit.Application.Repository.RepositoryResult<T>                                                             93.3%
  PatternKit.Application.ServiceLayer.ServiceLayerOperation<T1, T2>                                                 96.7%
  PatternKit.Application.ServiceLayer.ServiceLayerResult<T>                                                         94.7%
  PatternKit.Application.ServiceLayer.ServiceLayerRule<T>                                                            100%
  PatternKit.Application.Specification.Specification<T>                                                              100%

@JerrettDavis JerrettDavis merged commit 1de30bd into main May 30, 2026
13 checks passed
@JerrettDavis JerrettDavis deleted the test/event-notification-envelope-generator-coverage-413 branch May 30, 2026 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants