refactor!: replace CallBaseClass with SkipBaseClass#353
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the API by replacing the CallBaseClass concept with SkipBaseClass, inverting the boolean logic throughout the codebase. The change makes the API more intuitive by having false (the default) mean "call the base class" and true mean "skip calling the base class."
Key changes:
- Renamed
MockBehavior.CallBaseClasstoMockBehavior.SkipBaseClasswith inverted boolean logic - Renamed all setup methods from
CallingBaseClass()toSkippingBaseClass()across methods, properties, and indexers - Updated test expectations to reflect the inverted logic
- Updated documentation to describe the new behavior
Reviewed changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Source/Mockolate/MockBehavior.cs | Renamed property from CallBaseClass to SkipBaseClass with updated documentation |
| Source/Mockolate/MockBehaviorExtensions.cs | Renamed extension method from CallingBaseClass() to SkippingBaseClass() |
| Source/Mockolate/Setup/*.cs | Updated all setup classes to use SkipBaseClass with inverted logic |
| Source/Mockolate/MockRegistration.cs | Updated logic to check SkipBaseClass instead of CallBaseClass |
| Source/Mockolate.SourceGenerators/Sources/*.cs | Updated source generators to emit SkipBaseClass code |
| Tests/**/*.cs | Updated all tests to use new API and corrected test expectations for inverted boolean logic |
| README.md, Docs/**/*.md | Updated documentation to reflect the API change |
Test Results 14 files ±0 14 suites ±0 5m 12s ⏱️ -4s Results for commit a664aac. ± Comparison against base commit 10b4bc1. This pull request removes 65 and adds 65 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
🚀 Benchmark ResultsDetails
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 40 out of 40 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (4)
Source/Mockolate.SourceGenerators/Sources/Sources.ForMock.cs:1
- The condition check is incorrect. This should be checking the
SkipBaseClassproperty on the indexer result variable, not callingSkipBaseClassas a method on the string variable name. It should be:if (!+ indexerResultVarName +.SkipBaseClass)
using System.Text;
Source/Mockolate/Setup/Interfaces.MethodSetup.cs:1
- The documentation states "If not specified, use MockBehavior.SkipBaseClass" but this is slightly ambiguous. Consider clarifying to: "If not specified, the value from MockBehavior.SkipBaseClass is used." The same issue appears in other interface files.
using System;
Source/Mockolate/Setup/Interfaces.PropertySetup.cs:1
- Same documentation ambiguity as in the method setup interfaces. Consider clarifying to: "If not specified, the value from MockBehavior.SkipBaseClass is used."
using System;
Source/Mockolate/Setup/Interfaces.IndexerSetup.cs:1
- Same documentation ambiguity as in other setup interfaces. Consider clarifying to: "If not specified, the value from MockBehavior.SkipBaseClass is used."
using System;
|
|
This is addressed in release v0.50.0. |



This PR refactors the API by replacing the
CallBaseClassconcept withSkipBaseClass, inverting the boolean logic throughout the codebase. The change makes the API more intuitive by havingfalse(the default) mean "call the base class" andtruemean "skip calling the base class."Key changes
MockBehavior.CallBaseClasstoMockBehavior.SkipBaseClasswith inverted boolean logicCallingBaseClass()toSkippingBaseClass()across methods, properties, and indexers