refactor: simplify PropertySetup#400
Conversation
There was a problem hiding this comment.
Pull request overview
This PR simplifies the PropertySetup class by removing redundant logic and improving test coverage for callback handling.
Changes:
- Removed unnecessary
foundCallbacktracking variable inInvokeGetter - Simplified conditional logic for value initialization
- Added tests for
MethodSetupResult.TriggerCallbackswith null parameters - Improved test coverage for parameter callback invocation scenarios
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Source/Mockolate/Setup/PropertySetup.cs | Removed redundant foundCallback variable and simplified initialization logic in InvokeGetter and InitializeValue |
| Tests/Mockolate.Tests/MockMethods/SetupMethodTests.cs | Added tests for null parameter handling and parameter callback invocation with matching/non-matching counts |
|
Test Results 21 files ± 0 21 suites ±0 7m 46s ⏱️ + 1m 12s Results for commit adc78ad. ± Comparison against base commit 198f8cb. This pull request removes 1 and adds 3 tests. Note that renamed tests count towards both. |
🚀 Benchmark ResultsDetails
|
|
This is addressed in release v1.0.3. |



This PR simplifies the
PropertySetupclass by removing redundant logic and improving test coverage for callback handling.Key Changes:
foundCallbacktracking variable inInvokeGetterMethodSetupResult.TriggerCallbackswith null parameters