Skip to content

Comments

fix: string representation of Match.*#324

Merged
vbreuss merged 2 commits intomainfrom
topic/fix-match-tostring
Dec 16, 2025
Merged

fix: string representation of Match.*#324
vbreuss merged 2 commits intomainfrom
topic/fix-match-tostring

Conversation

@vbreuss
Copy link
Contributor

@vbreuss vbreuss commented Dec 16, 2025

This PR fixes the string representation of Match.* methods to include the Match. prefix, making the output more explicit and clear about the origin of these matcher methods.

Key changes:

  • Updated ToString() implementations in Match.AnyParameters(), Match.Parameters(), and Match.WithDefaultParameters() to include the "Match." prefix
  • Updated corresponding test assertions to expect the new string format with the prefix

@vbreuss vbreuss self-assigned this Dec 16, 2025
@vbreuss vbreuss added the bug Something isn't working label Dec 16, 2025
Copilot AI review requested due to automatic review settings December 16, 2025 07:11
Copy link

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

This PR fixes the string representation of Match.* methods to include the Match. prefix, making the output more explicit and clear about the origin of these matcher methods.

Key changes:

  • Updated ToString() implementations in Match.AnyParameters(), Match.Parameters(), and Match.WithDefaultParameters() to include the "Match." prefix
  • Updated corresponding test assertions to expect the new string format with the prefix

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Source/Mockolate/Match.AnyParameters.cs Updated ToString() to return "Match.AnyParameters()" instead of "AnyParameters()"
Source/Mockolate/Match.Parameters.cs Updated ToString() to return "Match.Parameters(...)" instead of "Parameters(...)"
Source/Mockolate/Match.WithDefaultParameters.cs Updated ToString() to return "Match.WithDefaultParameters()" instead of "WithDefaultParameters()"
Tests/Mockolate.Tests/MatchTests.AnyParametersTests.cs Updated test expectation to match new string format
Tests/Mockolate.Tests/MatchTests.ParametersTests.cs Updated test expectation to match new string format
Tests/Mockolate.Tests/MatchTests.WithDefaultParametersTests.cs Updated test expectation to match new string format
Tests/Mockolate.Tests/MockMethods/SetupMethodTests.cs Updated multiple test assertions to expect "Match.AnyParameters()" and added new tests for string representation with AnyParameters()

@vbreuss vbreuss enabled auto-merge (squash) December 16, 2025 07:14
@github-actions
Copy link

github-actions bot commented Dec 16, 2025

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.3 LTS (Noble Numbat)
AMD EPYC 7763 2.72GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.101
[Host] : .NET 10.0.1 (10.0.1, 10.0.125.57005), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Method Mean Error StdDev Gen0 Gen1 Allocated
Simple_Mockolate 1.533 μs 0.0255 μs 0.0213 μs 0.2232 - 3.66 KB
Simple_Moq 174.001 μs 1.0590 μs 0.8843 μs 0.4883 - 14.55 KB
Simple_NSubstitute 5.878 μs 0.0399 μs 0.0312 μs 0.5493 0.0076 9.09 KB
Simple_FakeItEasy 6.337 μs 0.1013 μs 0.0948 μs 0.4959 - 8.11 KB

@sonarqubecloud
Copy link

@github-actions
Copy link

Test Results

    14 files  ± 0      14 suites  ±0   5m 40s ⏱️ +24s
 1 780 tests + 2   1 779 ✅ + 2  1 💤 ±0  0 ❌ ±0 
11 917 runs  +14  11 916 ✅ +14  1 💤 ±0  0 ❌ ±0 

Results for commit 917029d. ± Comparison against base commit a561d1d.

This pull request removes 8 and adds 10 tests. Note that renamed tests count towards both.
Mockolate.Tests.MockMethods.SetupMethodTests+ReturnMethodWith2Parameters ‑ ToString_AnyParameterCombination_ShouldReturnMethodSignature
Mockolate.Tests.MockMethods.SetupMethodTests+ReturnMethodWith3Parameters ‑ ToString_AnyParameterCombination_ShouldReturnMethodSignature
Mockolate.Tests.MockMethods.SetupMethodTests+ReturnMethodWith4Parameters ‑ ToString_AnyParameterCombination_ShouldReturnMethodSignature
Mockolate.Tests.MockMethods.SetupMethodTests+ReturnMethodWith5Parameters ‑ ToString_AnyParameterCombination_ShouldReturnMethodSignature
Mockolate.Tests.MockMethods.SetupMethodTests+VoidMethodWith2Parameters ‑ ToString_AnyParameterCombination_ShouldReturnMethodSignature
Mockolate.Tests.MockMethods.SetupMethodTests+VoidMethodWith3Parameters ‑ ToString_AnyParameterCombination_ShouldReturnMethodSignature
Mockolate.Tests.MockMethods.SetupMethodTests+VoidMethodWith4Parameters ‑ ToString_AnyParameterCombination_ShouldReturnMethodSignature
Mockolate.Tests.MockMethods.SetupMethodTests+VoidMethodWith5Parameters ‑ ToString_AnyParameterCombination_ShouldReturnMethodSignature
Mockolate.Tests.MockMethods.SetupMethodTests+ReturnMethodWith1Parameters ‑ ToString_AnyParameters_ShouldReturnMethodSignature
Mockolate.Tests.MockMethods.SetupMethodTests+ReturnMethodWith2Parameters ‑ ToString_AnyParameters_ShouldReturnMethodSignature
Mockolate.Tests.MockMethods.SetupMethodTests+ReturnMethodWith3Parameters ‑ ToString_AnyParameters_ShouldReturnMethodSignature
Mockolate.Tests.MockMethods.SetupMethodTests+ReturnMethodWith4Parameters ‑ ToString_AnyParameters_ShouldReturnMethodSignature
Mockolate.Tests.MockMethods.SetupMethodTests+ReturnMethodWith5Parameters ‑ ToString_AnyParameters_ShouldReturnMethodSignature
Mockolate.Tests.MockMethods.SetupMethodTests+VoidMethodWith1Parameters ‑ ToString_AnyParameters_ShouldReturnMethodSignature
Mockolate.Tests.MockMethods.SetupMethodTests+VoidMethodWith2Parameters ‑ ToString_AnyParameters_ShouldReturnMethodSignature
Mockolate.Tests.MockMethods.SetupMethodTests+VoidMethodWith3Parameters ‑ ToString_AnyParameters_ShouldReturnMethodSignature
Mockolate.Tests.MockMethods.SetupMethodTests+VoidMethodWith4Parameters ‑ ToString_AnyParameters_ShouldReturnMethodSignature
Mockolate.Tests.MockMethods.SetupMethodTests+VoidMethodWith5Parameters ‑ ToString_AnyParameters_ShouldReturnMethodSignature

@vbreuss vbreuss merged commit 9e357f5 into main Dec 16, 2025
12 checks passed
@vbreuss vbreuss deleted the topic/fix-match-tostring branch December 16, 2025 07:19
@github-actions
Copy link

This is addressed in release v0.46.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working state: released The issue is released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant