coverage: add missing tests for Callback#401
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds test coverage for the Callback class's For and When methods, particularly testing how they work together to limit the number of matching invocations. The changes include tests for both void and return methods, with and without InParallel, and new low-level unit tests for the Callback class itself.
Changes:
- Added tests for
Formethod behavior when combined withWhenconditions in return method setups - Added tests for
Formethod behavior when combined withWhenconditions in void method setups and callbacks - Created a new test file with direct unit tests for the
Callbackclass - Removed an unnecessary blank line from the
Callbackclass implementation
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| Tests/Mockolate.Tests/MockMethods/SetupMethodTests.ReturnsThrowsTests.cs | Added tests for For method limiting matches on return and void method setups |
| Tests/Mockolate.Tests/MockMethods/SetupMethodTests.CallbackTests.cs | Added tests for For method limiting matches on callbacks with and without InParallel |
| Tests/Mockolate.Internal.Tests/CallbackTests.cs | New file with direct unit tests for the Callback class's Invoke methods with For and When |
| Source/Mockolate/Setup/Callback.cs | Removed unnecessary blank line |
|
🚀 Benchmark ResultsDetails
|
|
This is addressed in release v1.0.3. |



This PR adds test coverage for the
Callbackclass'sForandWhenmethods, particularly testing how they work together to limit the number of matching invocations. The changes include tests for both void and return methods, with and withoutInParallel, and new low-level unit tests for theCallbackclass itself.Key Changes:
Formethod behavior when combined withWhenconditions in return method setupsFormethod behavior when combined withWhenconditions in void method setups and callbacksCallbackclass