Skip to content

feat: support ref and out parameter migration#19

Merged
vbreuss merged 2 commits into
mainfrom
topic/migrate-ref-and-out-parameter
Apr 5, 2026
Merged

feat: support ref and out parameter migration#19
vbreuss merged 2 commits into
mainfrom
topic/migrate-ref-and-out-parameter

Conversation

@vbreuss
Copy link
Copy Markdown
Member

@vbreuss vbreuss commented Apr 5, 2026

Adds support in the Moq → Mockolate code fix to migrate ref/out arguments in Setup/Verify lambda invocations, and expands the test + example coverage to demonstrate the expected migrated output.

Changes:

  • Update MoqCodeFixProvider to transform ref/out arguments into Mockolate matchers (It.IsOut, It.IsAnyRef, It.IsRef) before existing Moq.It.* transformations.
  • Add new code-fix tests covering out parameters and ref parameters (including Moq.It.Ref<T>.IsAny).

@vbreuss vbreuss self-assigned this Apr 5, 2026
@vbreuss vbreuss added the enhancement New feature or request label Apr 5, 2026
Copilot AI review requested due to automatic review settings April 5, 2026 13:45
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 5, 2026

Test Results

  3 files  ±0    3 suites  ±0   1m 45s ⏱️ +12s
 41 tests +3   41 ✅ +3  0 💤 ±0  0 ❌ ±0 
123 runs  +9  123 ✅ +9  0 💤 ±0  0 ❌ ±0 

Results for commit 53412d9. ± Comparison against base commit 0baa023.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support in the Moq → Mockolate code fix to migrate ref/out arguments in Setup/Verify lambda invocations, and expands the test + example coverage to demonstrate the expected migrated output.

Changes:

  • Update MoqCodeFixProvider to transform ref/out arguments into Mockolate matchers (It.IsOut, It.IsAnyRef, It.IsRef) before existing Moq.It.* transformations.
  • Add new code-fix tests covering out parameters and ref parameters (including Moq.It.Ref<T>.IsAny).
  • Replace the previous example test file with a new MoqMigrationExamples example suite.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
Tests/Mockolate.Migration.Tests/MoqCodeFixProviderTests.SetupTests.cs Adds regression tests for ref/out argument migration behavior.
Tests/Mockolate.Migration.Example.Tests/MoqMigrationExamples.cs Introduces updated example code showing expected migrated usage patterns (including ref/out).
Tests/Mockolate.Migration.Example.Tests/Examples.cs Removes older example file in favor of the new consolidated examples.
Source/Mockolate.Migration.Analyzers.CodeFixers/MoqCodeFixProvider.cs Implements ref/out argument rewriting and wires it into Setup/Verify migration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Tests/Mockolate.Migration.Example.Tests/MoqMigrationExamples.cs
Comment thread Tests/Mockolate.Migration.Example.Tests/MoqMigrationExamples.cs
Comment thread Tests/Mockolate.Migration.Example.Tests/MoqMigrationExamples.cs
@vbreuss vbreuss merged commit c44ced2 into main Apr 5, 2026
5 checks passed
@vbreuss vbreuss deleted the topic/migrate-ref-and-out-parameter branch April 5, 2026 14:18
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 5, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 5, 2026

This is addressed in release v0.2.0.

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

Labels

enhancement New feature or request state: released The issue is released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants