refactor: remove dead code in delegate source generation#313
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes dead code related to delegate source generation and consolidates some test methods. The main focus is on cleaning up unused methods in the source generator and reorganizing test cases for better structure.
Key Changes
- Removed unused delegate-related source generation methods (
AppendDelegateExtensions,AppendMockExtensions) - Eliminated unused helper method
GetAllClasses()fromMockClass - Reorganized test methods by moving several tests to earlier positions in the test file
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Mockolate.SourceGenerators.Tests/Sources/MockClassTests.cs | Added test for special types support in mock generation |
| Tests/Mockolate.SourceGenerators.Tests/Sources/ForMockTests.ImplementClassTests.cs | Reorganized existing tests by moving them earlier in the file and added new tests for ref/out parameters and Span support |
| Source/Mockolate.SourceGenerators/Sources/Sources.ForMock.cs | Simplified XML documentation by removing iteration over additional implementations |
| Source/Mockolate.SourceGenerators/Sources/Sources.ForMock.CombinationExtensions.cs | Removed delegate extension generation methods and simplified the extension generation logic |
| Source/Mockolate.SourceGenerators/MockGenerator.cs | Updated method call to pass distinct additional implementations as parameter |
| Source/Mockolate.SourceGenerators/Entities/MockClass.cs | Removed unused GetAllClasses() helper method |
|
🚀 Benchmark ResultsDetails
|
|
This is addressed in release v0.45.0. |



This PR removes dead code related to delegate source generation and consolidates some test methods. The main focus is on cleaning up unused methods in the source generator and reorganizing test cases for better structure.
Key Changes
AppendDelegateExtensions,AppendMockExtensions)GetAllClasses()fromMockClass