Conversation
Test Results 9 files ± 0 9 suites ±0 2m 59s ⏱️ +19s Results for commit 57dd3b2. ± Comparison against base commit ba74810. This pull request removes 84 and adds 102 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull request overview
Enhances the NSubstitute→Mockolate migration code fix to handle CallInfo-based callbacks by rewriting them into Mockolate-compatible Do(...) / Returns(...) typed-parameter (or parameterless) lambdas, and documents/tests the new behavior.
Changes:
- Rewrite
When(...).Do(call => ...),Returns(call => ...), andAndDoes(call => ...)callbacks by dropping unusedCallInfoparameters or translating supportedCallInfoargument accesses into typed lambda parameters. - Add a new analyzer/code-fix test suite covering supported/unsupported
CallInforewrite cases (including TODO fallback cases). - Update README documentation and normalize playground test method names.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Mockolate.Migration.Tests/NSubstituteCodeFixProviderTests.WhenDoTests.cs | Updates expected output to drop unused CallInfo lambda parameters (Do(() => ...)). |
| Tests/Mockolate.Migration.Tests/NSubstituteCodeFixProviderTests.CallInfoTests.cs | New test coverage for CallInfo callback rewrite rules and TODO fallbacks. |
| Tests/Mockolate.Migration.Tests/NSubstituteCodeFixProviderTests.AndDoesTests.cs | Updates expected output to drop unused CallInfo lambda parameters on migrated .Do(...). |
| Tests/Mockolate.Migration.NSubstitutePlayground/WhenDoTests.cs | Renames test methods for consistent naming. |
| Tests/Mockolate.Migration.NSubstitutePlayground/UnsupportedFeatureTests.cs | Renames tests and updates commentary around partial CallInfo support. |
| Tests/Mockolate.Migration.NSubstitutePlayground/SetupTests.cs | Adds a runtime playground test demonstrating argument-dispatch via CallInfo in Returns. |
| Tests/Mockolate.Migration.NSubstitutePlayground/EventTests.cs | Renames test methods for consistent naming. |
| Tests/Mockolate.Migration.NSubstitutePlayground/CreationTests.cs | Renames test methods for consistent naming. |
| Tests/Mockolate.Migration.NSubstitutePlayground/ArgumentMatcherTests.cs | Renames test methods for consistent naming. |
| Tests/Mockolate.Migration.MoqPlayground/UnsupportedFeatureTests.cs | Renames test methods for consistent naming. |
| Tests/Mockolate.Migration.MoqPlayground/SetupTests.cs | Renames test methods for consistent naming. |
| Tests/Mockolate.Migration.MoqPlayground/SequenceTests.cs | Renames test methods for consistent naming. |
| Tests/Mockolate.Migration.MoqPlayground/EventTests.cs | Renames test methods for consistent naming. |
| Tests/Mockolate.Migration.MoqPlayground/CreationTests.cs | Renames test methods for consistent naming. |
| Tests/Mockolate.Migration.MoqPlayground/ArgumentMatcherTests.cs | Renames test methods for consistent naming. |
| Source/Mockolate.Migration.Analyzers.CodeFixers/NSubstituteCodeFixProvider.cs | Implements CallInfo callback rewriting + TODO injection and threads it through When/Do, Returns, and AndDoes. |
| README.md | Documents CallInfo callback migration behavior and fallback rules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
This is addressed in release v0.5.0. |



This pull request primarily standardizes the naming conventions for test methods across several test files and adds documentation for how CallInfo callbacks are migrated. The test method names have been updated to use PascalCase for readability and consistency. Additionally, the
README.mdnow includes a section explaining how CallInfo callback lambdas are migrated from NSubstitute to Mockolate.Documentation improvements:
README.mddescribing how CallInfo callbacks are migrated, with examples and guidance for different usage patterns.Test method naming standardization:
ArgumentMatcherTests.cs,CreationTests.cs,EventTests.cs,SequenceTests.cs, andSetupTests.csto use PascalCase for improved consistency and readability.