Skip to content

refactor: move snapshot tests to Mockolate.Tests project#728

Merged
vbreuss merged 1 commit into
mainfrom
topic/move-snapshot-tests
Apr 30, 2026
Merged

refactor: move snapshot tests to Mockolate.Tests project#728
vbreuss merged 1 commit into
mainfrom
topic/move-snapshot-tests

Conversation

@vbreuss
Copy link
Copy Markdown
Member

@vbreuss vbreuss commented Apr 30, 2026

This pull request primarily updates test and snapshot files to reflect a namespace change from Mockolate.ExampleTests.GeneratorCoverage to Mockolate.Tests.GeneratorCoverage and removes an obsolete test file. Additionally, there is a minor improvement to test cancellation support in the test harness.

The most important changes are:

Namespace Updates in Generated Test Snapshots

  • Updated all references in the generated mock extension files for ComprehensiveAbstractClass, ICombinationMockA, and ICombinationMockB to use the new namespace Mockolate.Tests.GeneratorCoverage instead of Mockolate.ExampleTests.GeneratorCoverage.

Test Harness Improvement

  • Updated the test in TypeIsFormattableTests.cs to pass the test cancellation token when parsing syntax trees, improving test harness cancellation support.

@vbreuss vbreuss self-assigned this Apr 30, 2026
@vbreuss vbreuss enabled auto-merge (squash) April 30, 2026 15:25
@vbreuss vbreuss force-pushed the topic/move-snapshot-tests branch from ad65f46 to 49da7a3 Compare April 30, 2026 15:26
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.60GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.203
[Host] : .NET 10.0.7 (10.0.7, 10.0.726.21808), X64 RyuJIT x86-64-v3

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

Method Mean Error StdDev Ratio RatioSD Gen0 Gen1 Allocated Alloc Ratio
Event_Mockolate 331.6 ns 4.45 ns 4.16 ns 1.00 0.02 0.1254 0.0005 2.05 KB 1.00
Event_Moq 15,860.9 ns 118.33 ns 98.81 ns 47.84 0.65 0.7324 - 12.51 KB 6.09
Event_NSubstitute 5,692.5 ns 33.44 ns 31.28 ns 17.17 0.23 0.5493 0.0076 9.05 KB 4.40
Event_FakeItEasy 211,323.4 ns 2,050.08 ns 1,817.34 ns 637.36 9.40 0.7324 0.4883 15.39 KB 7.49
Event_Imposter 1,362.2 ns 13.41 ns 11.89 ns 4.11 0.06 0.5379 0.0153 8.8 KB 4.29
Event_TUnitMocks 182.3 ns 4.08 ns 3.82 ns 0.55 0.01 0.0837 0.0002 1.37 KB 0.67
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.87GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.203
[Host] : .NET 10.0.7 (10.0.7, 10.0.726.21808), X64 RyuJIT x86-64-v3

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

Method N Mean Error StdDev Ratio RatioSD Gen0 Gen1 Allocated Alloc Ratio
Indexer_Mockolate 1 1,080.8 ns 31.34 ns 29.32 ns 1.00 0.04 0.2460 0.0019 4.03 KB 1.00
Indexer_Moq 1 166,979.5 ns 962.78 ns 803.97 ns 154.60 4.03 0.9766 0.4883 20.25 KB 5.02
Indexer_NSubstitute 1 8,748.6 ns 106.59 ns 99.71 ns 8.10 0.23 0.7782 - 12.78 KB 3.17
Indexer_FakeItEasy 1 10,044.5 ns 195.93 ns 183.27 ns 9.30 0.29 0.8392 0.0305 13.88 KB 3.44
Indexer_Imposter 1 917.7 ns 17.14 ns 16.04 ns 0.85 0.03 0.3147 0.0048 5.16 KB 1.28
Indexer_Mockolate 10 2,679.4 ns 32.43 ns 30.34 ns 1.00 0.02 0.3090 - 5.09 KB 1.00
Indexer_Moq 10 177,087.7 ns 495.61 ns 439.34 ns 66.10 0.74 1.7090 1.4648 28.64 KB 5.63
Indexer_NSubstitute 10 22,243.9 ns 213.62 ns 199.82 ns 8.30 0.12 1.5564 0.0305 25.58 KB 5.03
Indexer_FakeItEasy 10 21,939.0 ns 207.57 ns 173.33 ns 8.19 0.11 2.1667 0.0610 35.47 KB 6.97
Indexer_Imposter 10 2,241.6 ns 27.93 ns 24.75 ns 0.84 0.01 0.4845 0.0076 7.97 KB 1.57
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.87GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.203
[Host] : .NET 10.0.7 (10.0.7, 10.0.726.21808), X64 RyuJIT x86-64-v3

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

Method N Mean Error StdDev Ratio RatioSD Gen0 Gen1 Allocated Alloc Ratio
Method_Mockolate 1 463.1 ns 9.28 ns 8.68 ns 1.00 0.03 0.1416 0.0010 2.32 KB 1.00
Method_Moq 1 128,196.8 ns 668.12 ns 592.27 ns 276.89 5.21 0.4883 - 14.58 KB 6.28
Method_NSubstitute 1 5,464.8 ns 47.50 ns 42.11 ns 11.80 0.23 0.5569 0.0076 9.12 KB 3.93
Method_FakeItEasy 1 5,427.4 ns 68.84 ns 64.40 ns 11.72 0.25 0.4959 - 8.11 KB 3.50
Method_Imposter 1 567.7 ns 8.14 ns 7.22 ns 1.23 0.03 0.2470 0.0029 4.04 KB 1.74
Method_TUnitMocks 1 723.9 ns 16.07 ns 15.03 ns 1.56 0.04 0.1774 0.0010 2.9 KB 1.25
Method_Mockolate 10 753.9 ns 11.31 ns 10.58 ns 1.00 0.02 0.1545 0.0010 2.53 KB 1.00
Method_Moq 10 134,142.7 ns 869.56 ns 770.85 ns 177.96 2.60 0.9766 0.7324 18.48 KB 7.30
Method_NSubstitute 10 7,901.7 ns 114.70 ns 107.29 ns 10.48 0.20 0.7324 0.0153 12.07 KB 4.77
Method_FakeItEasy 10 8,685.7 ns 151.84 ns 134.60 ns 11.52 0.23 0.9766 0.0305 16.05 KB 6.34
Method_Imposter 10 1,160.6 ns 8.11 ns 6.77 ns 1.54 0.02 0.3376 0.0057 5.52 KB 2.18
Method_TUnitMocks 10 1,777.2 ns 16.15 ns 15.10 ns 2.36 0.04 0.2747 0.0019 4.49 KB 1.77
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.60GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.203
[Host] : .NET 10.0.7 (10.0.7, 10.0.726.21808), X64 RyuJIT x86-64-v3

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

Method N Mean Error StdDev Ratio RatioSD Gen0 Gen1 Allocated Alloc Ratio
Property_Mockolate 1 563.5 ns 7.35 ns 6.87 ns 1.00 0.02 0.1574 0.0010 2.58 KB 1.00
Property_Moq 1 10,372.8 ns 136.37 ns 127.56 ns 18.41 0.31 0.6104 - 10.39 KB 4.03
Property_NSubstitute 1 7,218.7 ns 57.91 ns 51.34 ns 12.81 0.18 0.6943 0.0076 11.45 KB 4.44
Property_FakeItEasy 1 7,533.6 ns 135.58 ns 120.19 ns 13.37 0.26 0.6866 - 11.24 KB 4.36
Property_Imposter 1 482.8 ns 16.04 ns 15.00 ns 0.86 0.03 0.1907 0.0019 3.13 KB 1.21
Property_TUnitMocks 1 810.0 ns 19.71 ns 18.44 ns 1.44 0.04 0.1526 0.0010 2.51 KB 0.97
Property_Mockolate 10 1,105.9 ns 20.33 ns 19.01 ns 1.00 0.02 0.1869 - 3.07 KB 1.00
Property_Moq 10 16,767.5 ns 148.63 ns 131.76 ns 15.17 0.28 1.0986 - 18.28 KB 5.95
Property_NSubstitute 10 16,602.5 ns 146.48 ns 129.85 ns 15.02 0.27 1.2817 0.0305 21.08 KB 6.87
Property_FakeItEasy 10 17,930.2 ns 295.15 ns 261.64 ns 16.22 0.35 1.8616 - 30.81 KB 10.03
Property_Imposter 10 1,120.5 ns 19.77 ns 18.50 ns 1.01 0.02 0.2842 0.0019 4.67 KB 1.52
Property_TUnitMocks 10 2,347.0 ns 26.98 ns 25.24 ns 2.12 0.04 0.2823 - 4.66 KB 1.52
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.60GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.203
[Host] : .NET 10.0.7 (10.0.7, 10.0.726.21808), X64 RyuJIT x86-64-v3

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

Method Mean Error StdDev Ratio RatioSD Gen0 Gen1 Allocated Alloc Ratio
Callback_Mockolate 407.4 ns 3.62 ns 3.21 ns 1.00 0.01 0.1197 - 1.96 KB 1.00
Callback_Moq 71,962.0 ns 558.96 ns 495.50 ns 176.64 1.78 0.4883 0.2441 8.88 KB 4.53
Callback_NSubstitute 4,253.1 ns 76.49 ns 67.81 ns 10.44 0.18 0.4730 0.0076 7.74 KB 3.95
Callback_FakeItEasy 4,492.4 ns 99.58 ns 93.15 ns 11.03 0.24 0.4120 0.0153 6.81 KB 3.47
Callback_Imposter 415.7 ns 4.92 ns 4.60 ns 1.02 0.01 0.1454 0.0010 2.38 KB 1.22
Callback_TUnitMocks 687.2 ns 11.76 ns 10.43 ns 1.69 0.03 0.1602 0.0010 2.63 KB 1.34

@github-actions
Copy link
Copy Markdown

Test Results

    21 files  ± 0      21 suites  ±0   9m 33s ⏱️ -15s
 3 874 tests + 8   3 872 ✅ + 8  2 💤 ±0  0 ❌ ±0 
25 136 runs  +24  25 132 ✅ +24  4 💤 ±0  0 ❌ ±0 

Results for commit 49da7a3. ± Comparison against base commit 7729e9d.

@vbreuss vbreuss merged commit 211fda2 into main Apr 30, 2026
16 checks passed
@vbreuss vbreuss deleted the topic/move-snapshot-tests branch April 30, 2026 15:36
@github-actions
Copy link
Copy Markdown

This is addressed in release v3.0.0.

@github-actions github-actions Bot added the state: released The issue is released label Apr 30, 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.

1 participant