Skip to content

feat: add event verification support for VerifyAdd and VerifyRemove#31

Merged
vbreuss merged 2 commits into
mainfrom
topic/add-event-verification
Apr 17, 2026
Merged

feat: add event verification support for VerifyAdd and VerifyRemove#31
vbreuss merged 2 commits into
mainfrom
topic/add-event-verification

Conversation

@vbreuss

@vbreuss vbreuss commented Apr 17, 2026

Copy link
Copy Markdown
Member

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(...) into mock.Mock.Verify.<Event>.Subscribed()/Unsubscribed() chains (including navigation chains and Times mapping).
  • Add dedicated code-fix tests covering event verification scenarios (custom delegates, nested events, and several Times cases).
  • Extend the example migration output to include event subscription/raising and verification examples.

@vbreuss vbreuss self-assigned this Apr 17, 2026
Copilot AI review requested due to automatic review settings April 17, 2026 17:26
@github-actions

github-actions Bot commented Apr 17, 2026

Copy link
Copy Markdown

Test Results

  3 files  ± 0    3 suites  ±0   2m 12s ⏱️ +18s
 57 tests + 8   57 ✅ + 8  0 💤 ±0  0 ❌ ±0 
171 runs  +24  171 ✅ +24  0 💤 ±0  0 ❌ ±0 

Results for commit 8162313. ± Comparison against base commit 6fdefa2.

♻️ This comment has been updated with latest results.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(...) into mock.Mock.Verify.<Event>.Subscribed()/Unsubscribed() chains (including navigation chains and Times mapping).
  • Add dedicated code-fix tests covering event verification scenarios (custom delegates, nested events, and several Times cases).
  • 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.

Comment thread Source/Mockolate.Migration.Analyzers.CodeFixers/MoqCodeFixProvider.cs Outdated
@vbreuss vbreuss enabled auto-merge (squash) April 17, 2026 17:54
@sonarqubecloud

Copy link
Copy Markdown

@vbreuss vbreuss merged commit 72cb575 into main Apr 17, 2026
9 checks passed
@vbreuss vbreuss deleted the topic/add-event-verification branch April 17, 2026 17:56
@github-actions

Copy link
Copy Markdown

This is addressed in release v0.3.0.

@github-actions github-actions Bot added the state: released The issue is released label Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state: released The issue is released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants