Skip to content

ignore abstract classes in registration#55

Merged
hasanxdev merged 2 commits into
mainfrom
hsn/fix-issue-54
Jul 11, 2026
Merged

ignore abstract classes in registration#55
hasanxdev merged 2 commits into
mainfrom
hsn/fix-issue-54

Conversation

@hasanxdev

@hasanxdev hasanxdev commented Jul 8, 2026

Copy link
Copy Markdown
Owner

this PR is related to #54

Copilot AI review requested due to automatic review settings July 8, 2026 22:01
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.RegisterNotification to 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.

@hasanxdev hasanxdev merged commit 8f81643 into main Jul 11, 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.

2 participants