Skip to content

Support open-generic notification handlers with full scenario tests#48

Merged
hasanxdev merged 4 commits into
mainfrom
copilot/issue-47-explanation
May 8, 2026
Merged

Support open-generic notification handlers with full scenario tests#48
hasanxdev merged 4 commits into
mainfrom
copilot/issue-47-explanation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

  • Identified 2 partial branches in ServiceRegistrator.RegisterNotification and simplified dead code to reach 100% coverage
  • Add GenericAwareNotification record to Sample project
  • Add AllNotificationsLogger<TNotification> open-generic handler to Sample project
  • Add /Notification/DispatchR/Generic endpoint to Program.cs
  • Build and verify the sample compiles (0 errors, 2 pre-existing warnings)
  • All 30 tests pass (21 unit + 9 integration)
  • Parallel validation passed

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@hasanxdev hasanxdev marked this pull request as ready for review May 8, 2026 15:56
Copilot AI review requested due to automatic review settings May 8, 2026 15:56
…d reach 100% coverage

Agent-Logs-Url: https://github.com/hasanxdev/DispatchR/sessions/90e47ff8-87c9-4142-88cf-83c7eec466cc

Co-authored-by: hasanxdev <30981174+hasanxdev@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for resolving and invoking open-generic notification handlers (INotificationHandler<>) via the DispatchR DI registration pipeline, and verifies behavior with unit + integration tests to ensure compatibility with existing concrete handlers.

Changes:

  • Updated notification handler registration to correctly register open-generic INotificationHandler<> implementations.
  • Added unit test to assert open-generic notification handler DI registration is present.
  • Added integration tests + fixtures covering publish scenarios for open-generic + specific handlers (and open-generic-only).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

File Description
src/DispatchR/Configuration/ServiceRegistrator.cs Normalizes open-generic notification handler registrations so DI can resolve INotificationHandler<T> for concrete notifications.
tests/DispatchR.UnitTest/AddDispatchRConfigurationTests.cs Adds a unit test ensuring the open-generic INotificationHandler<> registration exists in the service collection.
tests/DispatchR.IntegrationTest/NotificationTests.cs Adds end-to-end tests verifying Publish<T> and Publish(object) invoke both specific and open-generic handlers, plus open-generic-only behavior.
tests/DispatchR.TestCommon/Fixtures/Notification/OpenGeneric*.cs Introduces fixture notifications/handlers and a small execution store used by integration tests to assert handler invocation.

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

@hasanxdev hasanxdev merged commit 258c99f into main May 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants