Skip to content

test: harden example coverage gaps#463

Merged
JerrettDavis merged 1 commit into
mainfrom
coverage/harden-example-gaps-415
May 31, 2026
Merged

test: harden example coverage gaps#463
JerrettDavis merged 1 commit into
mainfrom
coverage/harden-example-gaps-415

Conversation

@JerrettDavis

Copy link
Copy Markdown
Owner

Closes #415.

Summary

  • expands TinyBDD coverage for example dependency injection, context map, domain events, pricing, interpreter, chain, facade, gateway routing, and enterprise demos
  • exercises production import surfaces, generated interpreter/facade paths, and failure handling branches
  • raises local PatternKit.Examples package coverage above the 95% floor

Validation

  • dotnet test test\PatternKit.Examples.Tests\PatternKit.Examples.Tests.csproj --configuration Release -p:TestTfmsInParallel=false --filter "FullyQualifiedName~MediatedTransactionPipelineDemoTests|FullyQualifiedName~InterpreterDemoTests|FullyQualifiedName~FacadeSpecsTests"
  • dotnet test test\PatternKit.Examples.Tests\PatternKit.Examples.Tests.csproj --configuration Release -p:TestTfmsInParallel=false --collect:"XPlat Code Coverage" --results-directory TestResults-examples-current -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura
  • PatternKit.Examples coverage: 95.12%

Copilot AI review requested due to automatic review settings May 31, 2026 00:38
@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

This PR expands PatternKit.Examples.Tests TinyBDD/xUnit coverage to close production example coverage gaps and push PatternKit.Examples above the 95% coverage floor (per #415), with added scenarios that exercise DI import surfaces, generated interpreter/facade paths, gateway routing, and additional failure branches.

Changes:

  • Added new scenarios across multiple example areas (pricing, interpreter, facade, gateway routing, enterprise, domain events, context map, and transaction pipeline) to hit previously uncovered production branches.
  • Strengthened the “DI importable” coverage test by resolving and executing additional registered collaborators (notifiers/identity/presence/rate-limiting).
  • Extended gateway routing and pipeline demos with additional route/tender/rounding coverage.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/PatternKit.Examples.Tests/Pricing/PricingDemoTests.cs Adds a scenario validating default pricing demo artifacts expose importable collaborators.
test/PatternKit.Examples.Tests/InterpreterDemo/InterpreterDemoTests.cs Adds scenarios covering remaining generated/fluent interpreter operators, terminals, and error branches.
test/PatternKit.Examples.Tests/Generators/FacadeSpecsTests.cs Adds additional facade/subsystem coverage for shipping and billing flows (including refund success path).
test/PatternKit.Examples.Tests/GatewayRoutingDemo/ProductGatewayRoutingDemoTests.cs Extends routing coverage to include pricing route assertions.
test/PatternKit.Examples.Tests/EnterpriseDemo/EnterpriseOrderDemoTests.cs Adds coverage for Asia fraud detector behavior.
test/PatternKit.Examples.Tests/DomainEventDemo/OrderDomainEventDemoTests.cs Adds a billed-event dispatch scenario covering fluent + generated dispatcher paths.
test/PatternKit.Examples.Tests/DependencyInjection/PatternKitExampleDependencyInjectionTests.cs Expands DI coverage by resolving and exercising additional notification collaborators and direct send paths.
test/PatternKit.Examples.Tests/ContextMapDemo/CommerceContextMapDemoTests.cs Extends context-map test to also exercise translator mappings.
test/PatternKit.Examples.Tests/Chain/MediatedTransactionPipelineDemoTests.cs Adds a new coverage-focused test class to exercise additional pipeline stages, tender failure paths, and charity tracker notifications.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ScenarioExpect.True(days > 0 && days <= 12);
}

[Scenario("ShippingSubsystems CoverFallbackDestinationsAndSpeeds")]
ScenarioExpect.Equal(29.99m, rates.CalculateBaseRate("international"));
ScenarioExpect.Equal(1.50m, rates.CalculateWeightSurcharge(8m));
ScenarioExpect.Equal(12, estimator.EstimateDays("international", "economy"));
ScenarioExpect.Equal("$31.49 - Delivery in 12 business days", quote);
ScenarioExpect.Equal("Refund amount exceeds original payment", excessiveRefund.ErrorMessage);
}

[Scenario("BillingSubsystems CoverSuccessfulRefundPath")]

public sealed class MediatedTransactionPipelineCoverageTests
{
[Scenario("TransactionPipelineBuilder FluentHooks Cover CustomStagesRulesAndCouponDiscounts")]
ScenarioExpect.True(result.Ctx.Log.Contains("preauth: empty basket"));
}

[Scenario("CardTenderHandlers Surface AuthorizationAndCaptureFailures")]
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

    12 files      12 suites   11m 22s ⏱️
 3 966 tests  3 966 ✅ 0 💤 0 ❌
12 329 runs  12 329 ✅ 0 💤 0 ❌

Results for commit 2d6f7d8.

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Summary
  Generated on: 05/31/2026 - 00:45:59
  Coverage date: 05/31/2026 - 00:43:21 - 05/31/2026 - 00:45:46
  Parser: MultiReport (12x Cobertura)
  Assemblies: 5
  Classes: 1715
  Files: 579
  Line coverage: 96.9%
  Covered lines: 45706
  Uncovered lines: 1441
  Coverable lines: 47147
  Total lines: 100699
  Branch coverage: 82.6% (14240 of 17232)
  Covered branches: 14240
  Total branches: 17232
  Method coverage: 97.2% (8965 of 9223)
  Full method coverage: 91.1% (8407 of 9223)
  Covered methods: 8965
  Fully covered methods: 8407
  Total methods: 9223

PatternKit.Core                                                                                                       96%
  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.EventualConsistency.EventualConsistencyEvaluation<T>                                       92.3%
  PatternKit.Application.EventualConsistency.EventualConsistencyMonitor<T>                                          97.2%
  PatternKit.Application.EventualConsistency.EventualConsistencyMonitorState<T>                                      100%
  PatternKit.Application.EventualConsistency.EventualConsistencyWatermarks<T>                                       96.7%
  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.ManualTaskGates.ManualTaskGate<T>                                                          98.5%
  PatternKit.Application.ManualTaskGates.ManualTaskGateState<T>                                                      100%
  PatternKit.Application.ManualTaskGates.ManualTaskRecord<T>                                                        96.9%

@codecov

codecov Bot commented May 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.08%. Comparing base (58ad9b3) to head (2d6f7d8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #463      +/-   ##
==========================================
+ Coverage   96.77%   97.08%   +0.31%     
==========================================
  Files         579      579              
  Lines       47147    47147              
  Branches     3095     6757    +3662     
==========================================
+ Hits        45626    45773     +147     
+ Misses       1521     1374     -147     
Flag Coverage Δ
unittests 97.08% <ø> (+0.31%) ⬆️

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.

@JerrettDavis JerrettDavis merged commit 36aeb3e into main May 31, 2026
13 checks passed
@JerrettDavis JerrettDavis deleted the coverage/harden-example-gaps-415 branch May 31, 2026 00:50
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.

Raise production example coverage above 95%

2 participants