-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: support inherited interfaces #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
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 adds support for inherited interfaces in the Mockerade source generator, allowing it to generate mocks for types that implement multiple interfaces or inherit from other interfaces.
Key changes:
- Enhanced type traversal to include all base types and interfaces when collecting mockable members
- Added explicit interface implementation support for handling method name conflicts
- Extended indexer property support with parameter handling
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Mockerade.SourceGenerators.Tests/Test.cs | Added test case for IList mock generation to verify inherited interface support |
| Source/Mockerade.SourceGenerators/Internals/SourceGeneration.MockClass.cs | Updated mock class generation to handle indexer properties and explicit interface implementations |
| Source/Mockerade.SourceGenerators/Internals/SourceGeneration.ExtensionsClass.cs | Modified extension method generation to exclude explicit implementations and indexers from certain operations |
| Source/Mockerade.SourceGenerators/Internals/GeneratorHelpers.cs | Refined mock detection logic and added type validation |
| Source/Mockerade.SourceGenerators/Entities/Type.cs | Added null safety for namespace handling |
| Source/Mockerade.SourceGenerators/Entities/Property.cs | Added indexer detection and parameter support |
| Source/Mockerade.SourceGenerators/Entities/Method.cs | Added explicit implementation tracking and containing type information |
| Source/Mockerade.SourceGenerators/Entities/Class.cs | Implemented comprehensive type hierarchy traversal and duplicate method handling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Source/Mockerade.SourceGenerators/Internals/SourceGeneration.MockClass.cs
Show resolved
Hide resolved
Source/Mockerade.SourceGenerators/Internals/SourceGeneration.ExtensionsClass.cs
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Source/Mockerade.SourceGenerators/Internals/SourceGeneration.MockClass.cs
Show resolved
Hide resolved
|
🚀 Benchmark ResultsDetails
|
👽 Mutation ResultsMockeradeDetails
The final mutation score is NaN%Coverage Thresholds: high:80 low:60 break:0 |


This PR adds support for inherited interfaces in the Mockerade source generator, allowing it to generate mocks for types that implement multiple interfaces or inherit from other interfaces.
Key changes: