Skip to content

test: reduce the generator snapshot tests - #1100

Merged
vbreuss merged 3 commits into
mainfrom
test/reduce-snapshots
Nov 21, 2026
Merged

vbreuss merged 3 commits into
mainfrom
test/reduce-snapshots

Conversation

@vbreuss

@vbreuss vbreuss commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Every generator special case added thousands of snapshot lines spread over many files, which made generator changes hard to review and the snapshot folder hard to navigate. The special cases in GeneratorCoverage are already covered by targeted tests (runtime tests in Mockolate.Tests and Generator.Run assertions), so their snapshots mostly added diffs that got accepted without review.

The snapshot folder goes from 172 files with about 200,000 lines to 30 files with about 44,000 lines.

What changes

  • Only the scenarios with Snapshot compare the generated files: the comprehensive interface and delegate (also in union mode), a base class with additional interfaces, HttpClient, logging, logger classes, auto-mocking and ref structs.
  • Every other scenario still runs and must compile without diagnostics. This is the only place that compiles the generated code with C# 14 and checks warnings and the documentation comments of the generated code, so it stays for every special case.
  • The files of the mocked types of a scenario are compared as one snapshot named after the scenario. The files that are not specific to a mocked type keep sharing a snapshot across scenarios.
  • A new test fails when a file that is not specific to a mocked type is only generated by scenarios without Snapshot, so a new shared file cannot go unreviewed.
  • Union scenarios whose output is identical to the classic one are removed. EqualsMembers and ObjectLookAlikes keep their union scenario, as their union output differs.
  • IOptionalMethodParametersWithSibling is merged into IOptionalMethodParameters as WithSibling, following the new rule that a special case only gets its own coverage type when it depends on the type.
  • Docs/agents/workflows.md describes when a special case adds a scenario, a _Unions scenario or its own coverage type.

Every generator special case added thousands of snapshot lines spread over many files (172 files on main), which made generator changes hard to review and the snapshot folder hard to navigate. Union mode only changes the setups and verifications of non-generic methods and indexers without params or ref struct parameters, so scenarios whose special case never reaches that code gain nothing from a union copy. The files that are not specific to a mocked type only differ in the arities or types they cover, so comparing them in a few representative scenarios is enough while every scenario still compiles them. Comparing the files of the mocked types of a scenario as one snapshot lets a special case add one snapshot instead of one per mocked type.
@vbreuss vbreuss self-assigned this Nov 21, 2026
@greptile-apps

greptile-apps Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

This PR reduces generator snapshots while keeping compile checks for special cases.

  • Generator scenarios still compile, while only selected ones compare snapshots.

The previous explicit-type finding is fixed. No new actionable issues were found.

Reviews (3) · Last reviewed commit: "test: fail when a shared generated file ..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 175 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread Docs/agents/workflows.md Resolved
@github-actions

Copy link
Copy Markdown

Test Results

    58 files  ± 0      58 suites  ±0   1h 54m 9s ⏱️ - 26m 51s
 5 345 tests  -  9   5 345 ✅  -  9  0 💤 ±0  0 ❌ ±0 
53 320 runs   - 36  53 320 ✅  - 36  0 💤 ±0  0 ❌ ±0 

Results for commit 9750eae. ± Comparison against base commit fa69238.

This pull request removes 31 and adds 16 tests. Note that renamed tests count towards both.
 x-myHeader3: baz, True)
)
Mockolate.Internal.Tests.Internals.WildcardTests ‑ ShouldSupportMultilineStrings(
Mockolate.Internal.Tests.Internals.WildcardTests ‑ ShouldSupportMultilineStrings(
Mockolate.SourceGenerators.Tests.MethodSetupsTests ‑ WhenImplementingObjectMethods_ShouldUseSpecialInterfaces(bool Equals(object obj);
Mockolate.SourceGenerators.Tests.MethodSetupsTests ‑ WhenImplementingObjectMethods_ShouldUseSpecialInterfaces(bool Equals(object obj);
Mockolate.SourceGenerators.Tests.MethodSetupsTests ‑ WhenImplementingObjectMethods_ShouldUseSpecialInterfaces(string ToString();
Mockolate.SourceGenerators.Tests.MethodSetupsTests ‑ WhenImplementingObjectMethods_ShouldUseSpecialInterfaces(string ToString();
Mockolate.SourceGenerators.Tests.Snapshot.MockGenerationSnapshotTests ‑ GeneratorOutput_MatchesExpectedSnapshot(EqualsMembers_CanBeCreated_Unions)
Mockolate.SourceGenerators.Tests.Snapshot.MockGenerationSnapshotTests ‑ GeneratorOutput_MatchesExpectedSnapshot(GenericMethodClosedOverObject_CanBeCreated_Unions)
…
Mockolate.Internal.Tests.Internals.WildcardTests ‑ ShouldSupportMultilineStrings(
)
Mockolate.Internal.Tests.Internals.WildcardTests ‑ ShouldSupportMultilineStrings(
)
Mockolate.SourceGenerators.Tests.MethodSetupsTests ‑ WhenImplementingObjectMethods_ShouldUseSpecialInterfaces(bool Equals(object obj);
int GetHashCode();, public override bool Equals(object obj), public override int GetHashCode())
Mockolate.SourceGenerators.Tests.MethodSetupsTests ‑ WhenImplementingObjectMethods_ShouldUseSpecialInterfaces(bool Equals(object obj);
int GetHashCode();, public override bool Equals(object obj), public override int GetHashCode())
Mockolate.SourceGenerators.Tests.MethodSetupsTests ‑ WhenImplementingObjectMethods_ShouldUseSpecialInterfaces(string ToString();
bool Equals(object obj);, public override string ToString(), public override bool Equals(object obj))
Mockolate.SourceGenerators.Tests.MethodSetupsTests ‑ WhenImplementingObjectMethods_ShouldUseSpecialInterfaces(string ToString();
bool Equals(object? obj);
int GetHashCode();, public override string ToString(), public override int GetHashCode(), public override bool Equals(object? obj))
Mockolate.SourceGenerators.Tests.MethodSetupsTests ‑ WhenImplementingObjectMethods_ShouldUseSpecialInterfaces(string ToString();
int GetHashCode();, public override string ToString(), public override int GetHashCode())
Mockolate.SourceGenerators.Tests.MethodSetupsTests ‑ WhenImplementingObjectMethods_ShouldUseSpecialInterfaces(string ToString();
bool Equals(object obj);, public override string ToString(), public override bool Equals(object obj))
Mockolate.SourceGenerators.Tests.MethodSetupsTests ‑ WhenImplementingObjectMethods_ShouldUseSpecialInterfaces(string ToString();
bool Equals(object? obj);
int GetHashCode();, public override string ToString(), public override int GetHashCode(), public override bool Equals(object? obj))
Mockolate.SourceGenerators.Tests.MethodSetupsTests ‑ WhenImplementingObjectMethods_ShouldUseSpecialInterfaces(string ToString();
int GetHashCode();, public override string ToString(), public override int GetHashCode())
…

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

🚀 Benchmark Results

Compared to main, which ran on the same runner. Times that change by more than 10% are marked.

Memory

Benchmark main PR Δ
Unconfigured (N=1000) 273,296 B 273,297 B 🔴 +1 B (±0%)

Time

Benchmark main PR Δ
Indexer (N=1) 366.1 ns 315.9 ns 🟢 -14%
Event 143.8 ns 128.7 ns 🟢 -11%
Async (N=1) 365.8 ns 744.5 ns 🔴 +104%
CompleteWorkflowBenchmarks
Complete Mean Error StdDev Ratio Allocated Alloc Ratio
Mockolate 1.708 μs 0.0156 μs 0.0130 μs 1.00 5.14 KB 1.00
Imposter 1.951 μs 0.0314 μs 0.0278 μs 1.14 7.21 KB 1.40
TUnitMocks 4.168 μs 0.0475 μs 0.0421 μs 2.44 16.95 KB 3.30
Moq 1,030.287 μs 8.4940 μs 7.5297 μs 603.21 90.48 KB 17.60
NSubstitute 270.215 μs 0.6665 μs 0.6234 μs 158.21 53.11 KB 10.33
FakeItEasy 306.635 μs 2.9545 μs 2.7636 μs 179.53 63.87 KB 12.42
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon)
AMD EPYC 9V74 3.69GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 11.0.100
  [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v4

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

MockCreationBenchmarks
CreateMock Mean Error StdDev Ratio Allocated Alloc Ratio
Mockolate 16.13 ns 1.510 ns 1.338 ns 1.01 136 B 1.00
Imposter 122.75 ns 1.594 ns 1.331 ns 7.66 504 B 3.71
TUnitMocks 29.28 ns 1.541 ns 1.441 ns 1.83 216 B 1.59
Moq 1,424.75 ns 13.255 ns 11.069 ns 88.86 2088 B 15.35
NSubstitute 1,990.68 ns 20.954 ns 19.601 ns 124.15 5032 B 37.00
FakeItEasy 1,600.44 ns 39.372 ns 36.828 ns 99.82 2755 B 20.26
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon)
AMD EPYC 7763 2.77GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 11.0.100
  [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v3

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

CompleteUnconfiguredBenchmarks
Unconfigured N Mean Error StdDev Ratio Allocated Alloc Ratio
Mockolate 1 456.0 ns 5.38 ns 4.77 ns 1.00 1.51 KB 1.00
Imposter 1 269.3 ns 1.72 ns 1.61 ns 0.59 1.06 KB 0.70
TUnitMocks 1 502.3 ns 3.37 ns 2.82 ns 1.10 1.81 KB 1.20
Moq 1 115,097.3 ns 554.75 ns 518.92 ns 252.42 9.79 KB 6.50
NSubstitute 1 7,433.3 ns 44.84 ns 41.94 ns 16.30 10.01 KB 6.64
FakeItEasy 1 7,463.0 ns 32.48 ns 28.79 ns 16.37 11.58 KB 7.68
Mockolate 10 1,602.8 ns 11.83 ns 11.06 ns 1.00 3.92 KB 1.00
Imposter 10 969.3 ns 10.08 ns 9.43 ns 0.60 2.89 KB 0.74
TUnitMocks 10 3,189.4 ns 28.44 ns 25.21 ns 1.99 8.47 KB 2.16
Moq 10 129,579.9 ns 569.41 ns 504.77 ns 80.85 24.53 KB 6.25
NSubstitute 10 23,806.9 ns 752.64 ns 704.02 ns 14.85 22.93 KB 5.85
FakeItEasy 10 27,812.4 ns 157.31 ns 131.36 ns 17.35 53.92 KB 13.75
Mockolate 1000 123,087.1 ns 748.02 ns 663.10 ns 1.00 266.89 KB 1.00
Imposter 1000 80,693.1 ns 1,419.83 ns 1,328.11 ns 0.66 203.99 KB 0.76
TUnitMocks 1000 296,106.8 ns 1,662.94 ns 1,388.63 ns 2.41 691.21 KB 2.59
Moq 1000 1,556,298.6 ns 10,350.86 ns 9,682.20 ns 12.64 1653.01 KB 6.19
NSubstitute 1000 1,742,616.2 ns 6,903.01 ns 5,764.33 ns 14.16 1434.49 KB 5.37
FakeItEasy 1000 2,825,166.1 ns 45,258.29 ns 42,334.63 ns 22.95 4690.81 KB 17.58
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon)
AMD EPYC 7763 2.75GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 11.0.100
  [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v3

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

CompleteMethodBenchmarks
Method N Mean Error StdDev Ratio Allocated Alloc Ratio
Mockolate 1 147.6 ns 0.94 ns 0.88 ns 1.00 608 B 1.00
Imposter 1 154.6 ns 5.87 ns 5.49 ns 1.05 728 B 1.20
TUnitMocks 1 429.0 ns 9.83 ns 9.19 ns 2.91 2088 B 3.43
Moq 1 72,065.4 ns 265.25 ns 248.12 ns 488.26 14906 B 24.52
NSubstitute 1 4,531.9 ns 22.53 ns 17.59 ns 30.70 9264 B 15.24
FakeItEasy 1 3,626.3 ns 24.43 ns 21.66 ns 24.57 8151 B 13.41
Mockolate 10 332.2 ns 2.46 ns 2.30 ns 1.00 1112 B 1.00
Imposter 10 326.2 ns 3.93 ns 3.68 ns 0.98 1088 B 0.98
TUnitMocks 10 1,324.8 ns 9.29 ns 8.69 ns 3.99 3840 B 3.45
Moq 10 73,314.6 ns 337.17 ns 315.39 ns 220.72 18883 B 16.98
NSubstitute 10 6,721.2 ns 24.40 ns 21.63 ns 20.23 11784 B 10.60
FakeItEasy 10 6,434.6 ns 80.16 ns 74.98 ns 19.37 16391 B 14.74
Mockolate 1000 22,741.8 ns 191.45 ns 179.08 ns 1.00 56552 B 1.00
Imposter 1000 18,624.2 ns 43.26 ns 38.35 ns 0.82 40688 B 0.72
TUnitMocks 1000 98,134.9 ns 342.23 ns 303.38 ns 4.32 203585 B 3.60
Moq 1000 231,183.9 ns 2,077.14 ns 1,942.96 ns 10.17 431908 B 7.64
NSubstitute 1000 208,873.2 ns 691.43 ns 646.76 ns 9.19 322016 B 5.69
FakeItEasy 1000 293,267.4 ns 2,386.42 ns 2,232.26 ns 12.90 944523 B 16.70
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon)
Intel Xeon 6975P-C 2.70GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 11.0.100
  [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v4

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

CompletePropertyBenchmarks
Property N Mean Error StdDev Ratio Allocated Alloc Ratio
Mockolate 1 330.6 ns 3.79 ns 3.36 ns 1.00 920 B 1.00
Imposter 1 227.2 ns 1.58 ns 1.48 ns 0.69 672 B 0.73
TUnitMocks 1 540.1 ns 3.84 ns 3.60 ns 1.63 1672 B 1.82
Moq 1 10,377.6 ns 43.87 ns 36.63 ns 31.39 10569 B 11.49
NSubstitute 1 7,518.6 ns 32.76 ns 29.04 ns 22.75 11664 B 12.68
FakeItEasy 1 7,647.2 ns 27.63 ns 25.84 ns 23.13 11204 B 12.18
Mockolate 10 751.3 ns 2.62 ns 2.45 ns 1.00 1784 B 1.00
Imposter 10 436.3 ns 2.00 ns 1.78 ns 0.58 960 B 0.54
TUnitMocks 10 1,977.1 ns 5.79 ns 5.13 ns 2.63 4024 B 2.26
Moq 10 16,846.9 ns 104.16 ns 97.43 ns 22.42 18505 B 10.37
NSubstitute 10 17,059.4 ns 147.78 ns 131.01 ns 22.71 21529 B 12.07
FakeItEasy 10 18,406.9 ns 97.52 ns 81.43 ns 24.50 30783 B 17.26
Mockolate 1000 52,072.1 ns 216.28 ns 180.60 ns 1.00 96824 B 1.00
Imposter 1000 24,557.0 ns 125.56 ns 111.30 ns 0.47 32641 B 0.34
TUnitMocks 1000 155,299.9 ns 326.94 ns 289.83 ns 2.98 242489 B 2.50
Moq 1000 670,415.5 ns 2,327.95 ns 2,063.67 ns 12.87 836505 B 8.64
NSubstitute 1000 1,059,785.1 ns 3,833.30 ns 2,992.79 ns 20.35 1139693 B 11.77
FakeItEasy 1000 1,315,809.7 ns 14,931.73 ns 13,967.15 ns 25.27 2194291 B 22.66
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon)
Intel Xeon Platinum 8370C CPU 2.80GHz (Max: 3.41GHz), 1 CPU, 4 logical and 2 physical cores
.NET SDK 11.0.100
  [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v4

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

CompleteIndexerBenchmarks
Indexer N Mean Error StdDev Ratio Allocated Alloc Ratio
Mockolate 1 315.9 ns 3.96 ns 3.70 ns 1.00 1.64 KB 1.00
Imposter 1 243.2 ns 2.93 ns 2.74 ns 0.77 1.07 KB 0.65
TUnitMocks 1 580.2 ns 6.82 ns 5.32 ns 1.84 2.72 KB 1.66
Moq 1 140,462.4 ns 1,172.99 ns 1,039.83 ns 444.66 20.32 KB 12.38
NSubstitute 1 7,455.5 ns 83.21 ns 77.84 ns 23.60 12.78 KB 7.79
FakeItEasy 1 7,576.5 ns 224.83 ns 210.31 ns 23.98 13.38 KB 8.16
Mockolate 10 958.5 ns 9.40 ns 8.80 ns 1.00 2.55 KB 1.00
Imposter 10 620.7 ns 5.84 ns 5.18 ns 0.65 2.13 KB 0.83
TUnitMocks 10 1,946.9 ns 11.80 ns 10.46 ns 2.03 5.37 KB 2.10
Moq 10 149,383.3 ns 818.29 ns 725.40 ns 155.86 29.69 KB 11.62
NSubstitute 10 18,489.9 ns 71.01 ns 62.95 ns 19.29 25.58 KB 10.01
FakeItEasy 10 16,962.7 ns 120.94 ns 113.13 ns 17.70 32.58 KB 12.75
Mockolate 1000 65,945.5 ns 317.52 ns 247.90 ns 1.00 103.1 KB 1.00
Imposter 1000 40,143.0 ns 316.09 ns 280.21 ns 0.61 118.15 KB 1.15
TUnitMocks 1000 143,901.0 ns 482.33 ns 451.17 ns 2.18 293.67 KB 2.85
Moq 1000 792,103.5 ns 3,064.91 ns 2,716.96 ns 12.01 1006.45 KB 9.76
NSubstitute 1000 1,252,263.9 ns 11,730.97 ns 10,973.16 ns 18.99 1465.65 KB 14.22
FakeItEasy 1000 1,121,182.8 ns 8,732.58 ns 8,168.46 ns 17.00 2153.11 KB 20.88
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon)
AMD EPYC 9V74 3.68GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 11.0.100
  [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v4

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

CompleteEventBenchmarks
Event Mean Error StdDev Ratio Allocated Alloc Ratio
Mockolate 128.7 ns 5.63 ns 5.27 ns 1.00 712 B 1.00
Imposter 166.5 ns 4.21 ns 3.73 ns 1.30 512 B 0.72
TUnitMocks 182.1 ns 6.33 ns 5.92 ns 1.42 1392 B 1.96
Moq 9,366.8 ns 88.15 ns 78.14 ns 72.91 12761 B 17.92
NSubstitute 3,980.9 ns 58.43 ns 54.65 ns 30.99 9192 B 12.91
FakeItEasy 108,623.2 ns 2,043.39 ns 1,911.39 ns 845.56 15579 B 21.88
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon)
Intel Xeon 6973P-C 4.20GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 11.0.100
  [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v4

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

CallbackBenchmarks
Callback Mean Error StdDev Ratio Allocated Alloc Ratio
Mockolate 193.0 ns 3.27 ns 3.06 ns 1.00 800 B 1.00
Imposter 192.1 ns 0.81 ns 0.76 ns 1.00 616 B 0.77
TUnitMocks 441.9 ns 3.47 ns 3.07 ns 2.29 2056 B 2.57
Moq 104,590.3 ns 599.96 ns 561.20 ns 542.14 9056 B 11.32
NSubstitute 4,446.7 ns 11.21 ns 9.36 ns 23.05 7864 B 9.83
FakeItEasy 4,436.9 ns 38.56 ns 36.07 ns 23.00 6930 B 8.66
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon)
AMD EPYC 7763 3.06GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 11.0.100
  [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v3

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

AsyncBenchmarks
Async N Mean Error StdDev Ratio Allocated Alloc Ratio
Mockolate 1 744.5 ns 5.03 ns 4.71 ns 1.00 1 KB 1.00
Imposter 1 414.1 ns 2.51 ns 2.23 ns 0.56 1.58 KB 1.58
TUnitMocks 1 1,062.4 ns 7.05 ns 5.88 ns 1.43 4.36 KB 4.36
Moq 1 332,001.9 ns 3,456.57 ns 3,064.16 ns 445.94 22.74 KB 22.74
NSubstitute 1 16,541.2 ns 347.03 ns 324.62 ns 22.22 19.1 KB 19.10
FakeItEasy 1 11,777.7 ns 163.70 ns 153.13 ns 15.82 14 KB 14.00
Mockolate 10 1,623.5 ns 6.11 ns 5.71 ns 1.00 2.97 KB 1.00
Imposter 10 1,433.0 ns 10.68 ns 9.47 ns 0.88 3.41 KB 1.15
TUnitMocks 10 4,954.5 ns 81.56 ns 76.29 ns 3.05 10.29 KB 3.47
Moq 10 371,129.7 ns 1,956.34 ns 1,829.96 ns 228.60 40.19 KB 13.54
NSubstitute 10 31,234.2 ns 420.21 ns 393.06 ns 19.24 29.41 KB 9.91
FakeItEasy 10 44,495.8 ns 718.81 ns 672.37 ns 27.41 59.08 KB 19.90
Mockolate 1000 145,568.2 ns 570.76 ns 505.97 ns 1.00 219.53 KB 1.00
Imposter 1000 113,818.4 ns 694.32 ns 649.47 ns 0.78 204.5 KB 0.93
TUnitMocks 1000 417,325.8 ns 2,639.94 ns 2,469.40 ns 2.87 687.49 KB 3.13
Moq 1000 4,194,373.0 ns 20,629.11 ns 16,105.85 ns 28.81 1891.04 KB 8.61
NSubstitute 1000 1,301,145.3 ns 10,917.97 ns 9,678.49 ns 8.94 1092.92 KB 4.98
FakeItEasy 1000 4,102,460.3 ns 61,100.88 ns 57,153.80 ns 28.18 4933.84 KB 22.47
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon)
AMD EPYC 7763 2.95GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 11.0.100
  [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v3

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

SequenceBenchmarks
Sequence Mean Error StdDev Ratio Allocated Alloc Ratio
Mockolate 3.865 μs 0.0608 μs 0.0569 μs 1.00 2.23 KB 1.00
Imposter 3.184 μs 0.0216 μs 0.0191 μs 0.82 2.23 KB 1.00
TUnitMocks 4.061 μs 0.0129 μs 0.0101 μs 1.05 3.27 KB 1.46
Moq 13.125 μs 0.1235 μs 0.1155 μs 3.40 10.79 KB 4.83
NSubstitute 11.538 μs 0.1500 μs 0.1329 μs 2.99 14.67 KB 6.57
FakeItEasy 11.976 μs 0.0577 μs 0.0511 μs 3.10 14.27 KB 6.39
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon)
INTEL XEON PLATINUM 8573C 2.99GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 11.0.100
  [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v4

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

The special cases in GeneratorCoverage are covered by targeted tests, so their snapshots mostly added diffs that got accepted without review. Their scenarios still check that the generated code compiles without diagnostics under C# 14, with warnings and documentation comments checked, which no other test project does. The union scenarios of EqualsMembers and ObjectLookAlikes come back for that check, as their union output differs from the classic one.
Edge-case scenarios no longer compare snapshots, so a new file that is not specific to a mocked type would go unreviewed if only an edge case generates it.

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 2 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread Docs/agents/workflows.md Resolved
@sonarqubecloud

Copy link
Copy Markdown

@vbreuss
vbreuss merged commit d1b3146 into main Nov 21, 2026
26 checks passed
@vbreuss
vbreuss deleted the test/reduce-snapshots branch November 21, 2026 10:38
github-actions Bot added a commit that referenced this pull request Nov 21, 2026
github-actions Bot added a commit that referenced this pull request Nov 21, 2026
vbreuss added a commit that referenced this pull request Nov 21, 2026
The special cases do not depend on their own type, so they join an existing coverage type without a snapshot of their own (#1100). Union mode never applies to a method with a same-named sibling, so the sibling check there had no effect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant