Introduce new abstract base class Setup
#671
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
MethodCall
represents a setup that is programmable through Moq'sSetup
API. There are, however, certain kinds of "internal" setups that are not programmable and have much simpler logic.The intent behind this refactoring is to create a base class for all setups that has a much smaller memory footprint and contains much less logic. Internal, non-programmable setup types can then eventually be derived from that new
Setup
class.This PR includes the conversion of
PropertyGetterMethodCall
,PropertySetterMethodCall
, andSequenceMethodCall
to the new & lighter-weightSetup
base class, including renames to more precise & more consistent names:PropertyGetterMethodCall
→AutoImplementedPropertyGetterSetup
PropertySetterMethodCall
→AutoImplementedPropertySetterSetup
SequenceMethodCall
→SequenceSetup
This PR does not change
MethodCall
itself much—that is left to a separate, future refactoring.