You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request improves the fast-path verification logic in the MockRegistry class and significantly expands the unit tests for indexer, property, method, and event verification when using member IDs and fast buffers. The changes ensure that verification methods correctly use the available buffers for efficient interaction counting and expectation generation, and they add comprehensive tests to cover both fast-path and fallback scenarios.
Key changes include:
Fast-path logic improvements
Simplified the implementations of IndexerGot and IndexerSet in MockRegistry.Verify.cs to directly use the result of TryGetBuffer(memberId) in the VerificationResult constructor, removing unnecessary null checks and fallback logic within these methods.
Unit test coverage expansion
Added new tests in TypedVerifyFastPathTests.cs to cover:
Indexer getter/setter verification with member IDs and buffers, ensuring correct counting and expectation messages.
Event subscription/unsubscription verification with and without buffers, checking both fast-path and fallback behavior.
Method invocation verification with member IDs but no matching buffer, confirming fallback predicate matches.
Property getter/setter verification with member IDs and buffers, validating correct interaction counting and expectation formatting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
coverageAdditional tests for edge cases or improvement of test coveragestate: releasedThe issue is released
1 participant
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.
This pull request improves the fast-path verification logic in the
MockRegistryclass and significantly expands the unit tests for indexer, property, method, and event verification when using member IDs and fast buffers. The changes ensure that verification methods correctly use the available buffers for efficient interaction counting and expectation generation, and they add comprehensive tests to cover both fast-path and fallback scenarios.Key changes include:
Fast-path logic improvements
IndexerGotandIndexerSetinMockRegistry.Verify.csto directly use the result ofTryGetBuffer(memberId)in theVerificationResultconstructor, removing unnecessary null checks and fallback logic within these methods.Unit test coverage expansion
TypedVerifyFastPathTests.csto cover: