Skip to content

refactor: update to .NET SDK version 10.0.300#781

Merged
vbreuss merged 1 commit into
mainfrom
topic/require-net-10.0.300
May 14, 2026
Merged

refactor: update to .NET SDK version 10.0.300#781
vbreuss merged 1 commit into
mainfrom
topic/require-net-10.0.300

Conversation

@vbreuss
Copy link
Copy Markdown
Member

@vbreuss vbreuss commented May 14, 2026

This pull request updates the extension method signatures in Mockolate to improve nullability handling and simplify type constraints. The changes make the extension methods more flexible by allowing nullable types and optional builder parameters, and by removing unnecessary notnull constraints.

Nullability and Type Constraint Updates

  • All extension methods in Mockolate.Setup and Mockolate.Verify now accept nullable generic type arguments (e.g., T?, T1?, etc.) and the builder parameters themselves are now nullable (e.g., IPropertySetupReturnWhenBuilder<T?>?). This change increases the flexibility of the API and improves compatibility with nullable reference types.
  • The where T : notnull and similar type constraints have been removed from all relevant extension methods, further relaxing the requirements on generic parameters.

@vbreuss vbreuss self-assigned this May 14, 2026
Copilot AI review requested due to automatic review settings May 14, 2026 06:50
@vbreuss vbreuss added the dependencies Pull requests that update a dependency file label May 14, 2026
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

Bumps the .NET SDK pin from 10.0.201 to 10.0.300 and refreshes the public-API baseline snapshots (Mockolate_netstandard2.0.txt, Mockolate_net8.0.txt, Mockolate_net10.0.txt) to match the new SDK's API-extractor rendering of extension declarations. The previous output emitted extension<T>(... <T> setup) where T : notnull; the new SDK renders the same declarations as extension<T>(... <T?>? setup) (constraint removed, generic args and parameter annotated nullable). No source code is changed — only the SDK version and the expected-output text files used by the API compatibility tests.

Changes:

  • Update global.json SDK to 10.0.300.
  • Regenerate API baseline files for netstandard2.0, net8.0, and net10.0 to match the new compiler/API-extractor formatting of extension blocks.

Reviewed changes

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

File Description
global.json Bumps SDK version to 10.0.300.
Tests/Mockolate.Api.Tests/Expected/Mockolate_netstandard2.0.txt Refreshes extension declarations to new nullable-annotated rendering.
Tests/Mockolate.Api.Tests/Expected/Mockolate_net8.0.txt Same baseline refresh for net8.0.
Tests/Mockolate.Api.Tests/Expected/Mockolate_net10.0.txt Same baseline refresh for net10.0.

@vbreuss vbreuss enabled auto-merge (squash) May 14, 2026 06:52
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

Test Results

    24 files  ±0      24 suites  ±0   9m 45s ⏱️ +12s
 4 148 tests ±0   4 146 ✅ +3  2 💤 ±0  0 ❌  - 3 
26 688 runs  ±0  26 684 ✅ +3  4 💤 ±0  0 ❌  - 3 

Results for commit fd8b7f3. ± Comparison against base commit 9567a84.

@vbreuss vbreuss merged commit ca969bc into main May 14, 2026
21 checks passed
@vbreuss vbreuss deleted the topic/require-net-10.0.300 branch May 14, 2026 06:58
@github-actions
Copy link
Copy Markdown

🚀 Benchmark Results

Details

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

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

CreateMock Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 67.77 ns 0.790 ns 0.739 ns 1.12 440 B 1.00
Mockolate 60.55 ns 1.691 ns 1.582 ns 1.00 440 B 1.00
Imposter 264.95 ns 1.498 ns 1.328 ns 4.38 2248 B 5.11
TUnitMocks 33.00 ns 0.163 ns 0.153 ns 0.55 192 B 0.44
Moq 1,345.46 ns 2.312 ns 1.930 ns 22.23 2096 B 4.76
NSubstitute 1,907.21 ns 4.283 ns 3.797 ns 31.52 5048 B 11.47
FakeItEasy 1,727.87 ns 3.653 ns 3.417 ns 28.55 2763 B 6.28
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.300
[Host] : .NET 10.0.8 (10.0.8, 10.0.826.23019), X64 RyuJIT x86-64-v4

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

Event Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 314.0 ns 5.27 ns 4.93 ns 0.93 1.78 KB 1.00
Mockolate 337.9 ns 7.35 ns 6.87 ns 1.00 1.78 KB 1.00
Imposter 1,515.6 ns 32.58 ns 30.47 ns 4.49 8.8 KB 4.94
TUnitMocks 231.3 ns 2.89 ns 2.57 ns 0.68 1.34 KB 0.75
Moq 15,608.8 ns 49.00 ns 45.83 ns 46.21 12.51 KB 7.02
NSubstitute 5,934.6 ns 57.03 ns 53.35 ns 17.57 9.05 KB 5.08
FakeItEasy 190,299.9 ns 1,110.83 ns 984.72 ns 563.39 15.26 KB 8.57
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.300
[Host] : .NET 10.0.8 (10.0.8, 10.0.826.23019), X64 RyuJIT x86-64-v4

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

Indexer N Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 1 915.4 ns 10.94 ns 9.70 ns 0.91 3.82 KB 1.00
Mockolate 1 1.002 μs 0.0263 μs 0.0246 μs 1.00 3.82 KB 1.00
Imposter 1 1.053 μs 0.0352 μs 0.0329 μs 1.05 5.16 KB 1.35
Moq 1 168.524 μs 0.8033 μs 0.7121 μs 168.24 20.44 KB 5.35
NSubstitute 1 9.692 μs 0.0221 μs 0.0206 μs 9.68 12.84 KB 3.36
FakeItEasy 1 11.555 μs 0.0527 μs 0.0493 μs 11.54 13.62 KB 3.56
baseline* 10 2,432.7 ns 50.74 ns 47.47 ns 0.83 4.88 KB 1.00
Mockolate 10 2.918 μs 0.0037 μs 0.0034 μs 1.00 4.88 KB 1.00
Imposter 10 2.460 μs 0.0206 μs 0.0182 μs 0.84 7.97 KB 1.63
Moq 10 179.360 μs 0.6084 μs 0.5691 μs 61.47 29.97 KB 6.15
NSubstitute 10 22.725 μs 0.0587 μs 0.0549 μs 7.79 25.63 KB 5.26
FakeItEasy 10 23.654 μs 0.0756 μs 0.0707 μs 8.11 32.98 KB 6.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.300
[Host] : .NET 10.0.8 (10.0.8, 10.0.826.23019), X64 RyuJIT x86-64-v3

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

Method N Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 1 365.9 ns 2.90 ns 2.72 ns 1.03 2.04 KB 1.00
Mockolate 1 354.3 ns 2.56 ns 2.27 ns 1.00 2.04 KB 1.00
Imposter 1 541.3 ns 1.51 ns 1.26 ns 1.53 4.04 KB 1.98
TUnitMocks 1 446.2 ns 2.32 ns 2.17 ns 1.26 1.88 KB 0.92
Moq 1 133,148.8 ns 609.67 ns 509.10 ns 375.86 14.58 KB 7.15
NSubstitute 1 5,309.5 ns 85.05 ns 79.56 ns 14.99 9.12 KB 4.47
FakeItEasy 1 5,385.1 ns 86.51 ns 80.92 ns 15.20 8.05 KB 3.95
baseline* 10 636.8 ns 3.37 ns 2.99 ns 1.00 2.25 KB 1.00
Mockolate 10 635.4 ns 10.77 ns 10.07 ns 1.00 2.25 KB 1.00
Imposter 10 1,094.1 ns 4.21 ns 3.73 ns 1.72 5.52 KB 2.45
TUnitMocks 10 1,238.9 ns 4.63 ns 4.33 ns 1.95 3.52 KB 1.57
Moq 10 138,765.7 ns 811.52 ns 759.09 ns 218.44 18.48 KB 8.21
NSubstitute 10 7,717.5 ns 34.60 ns 32.36 ns 12.15 12.07 KB 5.37
FakeItEasy 10 8,219.8 ns 24.13 ns 21.39 ns 12.94 15.42 KB 6.85
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.300
[Host] : .NET 10.0.8 (10.0.8, 10.0.826.23019), X64 RyuJIT x86-64-v4

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

Property N Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 1 516.9 ns 6.22 ns 5.52 ns 0.81 2.47 KB 1.00
Mockolate 1 636.1 ns 7.87 ns 6.97 ns 1.00 2.47 KB 1.00
Imposter 1 548.7 ns 9.15 ns 8.56 ns 0.86 3.13 KB 1.27
TUnitMocks 1 485.1 ns 1.97 ns 1.85 ns 0.76 1.49 KB 0.60
Moq 1 11,374.0 ns 28.62 ns 25.37 ns 17.88 10.39 KB 4.21
NSubstitute 1 7,927.5 ns 15.56 ns 13.79 ns 12.46 11.45 KB 4.64
FakeItEasy 1 8,426.0 ns 16.74 ns 14.84 ns 13.25 11.25 KB 4.56
baseline* 10 1,059.1 ns 16.93 ns 15.84 ns 0.80 2.96 KB 1.00
Mockolate 10 1,326.8 ns 7.48 ns 6.63 ns 1.00 2.96 KB 1.00
Imposter 10 1,423.3 ns 7.16 ns 6.70 ns 1.07 4.67 KB 1.58
TUnitMocks 10 1,744.3 ns 5.59 ns 5.23 ns 1.31 3.65 KB 1.23
Moq 10 18,432.8 ns 32.56 ns 30.45 ns 13.89 18.28 KB 6.17
NSubstitute 10 16,881.1 ns 46.31 ns 43.32 ns 12.72 21.08 KB 7.12
FakeItEasy 10 19,272.7 ns 39.35 ns 32.86 ns 14.53 30.8 KB 10.40
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.300
[Host] : .NET 10.0.8 (10.0.8, 10.0.826.23019), X64 RyuJIT x86-64-v3

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

Callback Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 313.6 ns 0.95 ns 0.89 ns 1.01 1.68 KB 1.00
Mockolate 310.8 ns 3.71 ns 3.47 ns 1.00 1.68 KB 1.00
Imposter 404.0 ns 2.18 ns 1.93 ns 1.30 2.38 KB 1.42
TUnitMocks 480.9 ns 3.37 ns 3.15 ns 1.55 1.86 KB 1.11
Moq 72,496.6 ns 435.76 ns 386.29 ns 233.27 8.88 KB 5.29
NSubstitute 4,110.4 ns 31.32 ns 26.15 ns 13.23 7.74 KB 4.61
FakeItEasy 4,215.1 ns 15.20 ns 12.70 ns 13.56 6.81 KB 4.05

baseline* rows show the corresponding Mockolate benchmark from the most recent successful main branch build with results, for regression comparison.

github-actions Bot added a commit that referenced this pull request May 14, 2026
github-actions Bot added a commit that referenced this pull request May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants