feat: add event verification support for VerifyAdd and VerifyRemove#31
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Moq VerifyAdd / VerifyRemove migration support to the Moq→Mockolate code fix, along with new regression tests and updated example documentation.
Changes:
- Implement migration of
mock.VerifyAdd(...)/mock.VerifyRemove(...)intomock.Mock.Verify.<Event>.Subscribed()/Unsubscribed()chains (including navigation chains andTimesmapping). - Add dedicated code-fix tests covering event verification scenarios (custom delegates, nested events, and several
Timescases). - Extend the example migration output to include event subscription/raising and verification examples.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Tests/Mockolate.Migration.Tests/MoqCodeFixProviderTests.VerifyEventTests.cs | New test coverage for VerifyAdd/VerifyRemove migrations. |
| Tests/Mockolate.Migration.Example.Tests/MoqMigrationExamples.cs | Example updates demonstrating event raise + verify patterns and required namespace import. |
| Source/Mockolate.Migration.Analyzers.CodeFixers/MoqCodeFixProvider.cs | Core implementation: adds VerifyAdd/VerifyRemove detection and replacement generation + Verify using injection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
This is addressed in release v0.3.0. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Adds Moq
VerifyAdd/VerifyRemovemigration support to the Moq→Mockolate code fix, along with new regression tests and updated example documentation.Changes:
mock.VerifyAdd(...)/mock.VerifyRemove(...)intomock.Mock.Verify.<Event>.Subscribed()/Unsubscribed()chains (including navigation chains andTimesmapping).Timescases).