ignore abstract classes in registration#55
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This pull request updates DispatchR’s assembly-scanning notification registration to ignore non-instantiable types (interfaces and abstract classes), preventing invalid DI registrations when RegisterNotifications is enabled.
Changes:
- Update
ServiceRegistrator.RegisterNotificationto only consider concrete classes (skip interfaces/abstract types). - Add a unit test covering the “skip interface + abstract” notification handler scenario.
- Add new test fixtures to represent an abstract notification handler and an interface-based notification handler pattern.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/DispatchR.UnitTest/AddDispatchRConfigurationTests.cs | Adds a regression test ensuring interfaces and abstract handlers are not registered for notifications. |
| tests/DispatchR.TestCommon/Fixtures/Notification/WorkflowNotification.cs | Adds a generic notification type used by the new fixture handlers. |
| tests/DispatchR.TestCommon/Fixtures/Notification/IWorkflowNotificationHandler.cs | Adds an interface-based notification handler fixture to verify interface types are skipped during registration. |
| tests/DispatchR.TestCommon/Fixtures/Notification/IWorkflowEvent.cs | Adds a marker interface used by the generic workflow notification fixture. |
| tests/DispatchR.TestCommon/Fixtures/Notification/ConcreteWorkflowNotificationHandler.cs | Adds a concrete notification handler fixture to verify valid handlers still register. |
| tests/DispatchR.TestCommon/Fixtures/Notification/ConcreteWorkflowEvent.cs | Adds a concrete workflow event fixture used by the notification type. |
| tests/DispatchR.TestCommon/Fixtures/Notification/AbstractNotificationHandler.cs | Adds an abstract handler fixture to verify abstract types are skipped during registration. |
| src/DispatchR/Configuration/ServiceRegistrator.cs | Filters notification handler candidates to concrete classes only before DI registration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this PR is related to #54