Skip to content

docs: refine static interface members page#771

Merged
vbreuss merged 2 commits into
mainfrom
docs/static-interface-members-example
May 10, 2026
Merged

docs: refine static interface members page#771
vbreuss merged 2 commits into
mainfrom
docs/static-interface-members-example

Conversation

@vbreuss
Copy link
Copy Markdown
Member

@vbreuss vbreuss commented May 10, 2026

Drop the ".NET 8+" suffix from the headline (kept inline in the body) and replace the placeholder example with an explicit IChocolateFactory interface using chocolate-themed setup, raise, and verify calls.

Drop the ".NET 8+" suffix from the headline (kept inline in the body)
and replace the placeholder example with an explicit IChocolateFactory
interface using chocolate-themed setup, raise, and verify calls.
@vbreuss vbreuss self-assigned this May 10, 2026
Copilot AI review requested due to automatic review settings May 10, 2026 11:15
@vbreuss vbreuss added the documentation Improvements or additions to documentation label May 10, 2026
@vbreuss vbreuss enabled auto-merge (squash) May 10, 2026 11:15
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

Updates the documentation for Mockolate’s static interface member mocking feature by simplifying the page headline and replacing the placeholder snippet with a concrete chocolate-factory themed example.

Changes:

  • Removed the “.NET 8+” suffix from the page title (kept the requirement in the body text).
  • Replaced the placeholder static-member setup/raise/verify snippet with an explicit IChocolateFactory example using SetupStatic, RaiseStatic, and VerifyStatic.

Comment thread Docs/pages/advanced-features/02-static-interface-members.md
Comment thread Docs/pages/advanced-features/02-static-interface-members.md
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 10, 2026

Test Results

    24 files  ±0      24 suites  ±0   9m 11s ⏱️ -16s
 4 086 tests ±0   4 084 ✅ ±0  2 💤 ±0  0 ❌ ±0 
26 388 runs  ±0  26 384 ✅ ±0  4 💤 ±0  0 ❌ ±0 

Results for commit 141583f. ± Comparison against base commit 51e47a3.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 10, 2026

🚀 Benchmark Results

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

CreateMock Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 77.36 ns 0.436 ns 0.386 ns 1.15 440 B 1.00
Mockolate 67.28 ns 1.096 ns 0.971 ns 1.00 440 B 1.00
Imposter 295.32 ns 5.449 ns 4.830 ns 4.39 2248 B 5.11
TUnitMocks 42.69 ns 0.553 ns 0.490 ns 0.63 224 B 0.51
Moq 1,401.97 ns 8.912 ns 7.900 ns 20.84 2096 B 4.76
NSubstitute 1,898.73 ns 41.898 ns 39.192 ns 28.22 5048 B 11.47
FakeItEasy 1,842.07 ns 57.796 ns 54.062 ns 27.38 2763 B 6.28
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

Event Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 290.4 ns 3.27 ns 2.90 ns 0.95 1.78 KB 1.00
Mockolate 305.4 ns 1.62 ns 1.52 ns 1.00 1.78 KB 1.00
Imposter 1,316.6 ns 18.70 ns 16.58 ns 4.31 8.8 KB 4.94
TUnitMocks 178.4 ns 1.54 ns 1.29 ns 0.58 1.37 KB 0.77
Moq 13,904.4 ns 92.51 ns 82.01 ns 45.53 12.51 KB 7.02
NSubstitute 5,169.1 ns 21.38 ns 18.95 ns 16.93 9.05 KB 5.08
FakeItEasy 227,640.6 ns 691.78 ns 613.25 ns 745.43 15.26 KB 8.57
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.73GHz, 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

Indexer N Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 1 989.6 ns 37.92 ns 35.47 ns 1.07 3.81 KB 1.00
Mockolate 1 926.7 ns 13.29 ns 12.44 ns 1.00 3.81 KB 1.00
Imposter 1 846.3 ns 14.84 ns 12.39 ns 0.91 5.16 KB 1.35
Moq 1 216,618.0 ns 1,160.21 ns 1,028.50 ns 233.78 20.25 KB 5.31
NSubstitute 1 9,309.9 ns 49.96 ns 46.73 ns 10.05 12.78 KB 3.35
FakeItEasy 1 11,920.0 ns 30.05 ns 25.10 ns 12.86 13.63 KB 3.57
baseline* 10 2,551.7 ns 33.56 ns 31.40 ns 1.09 4.87 KB 1.00
Mockolate 10 2,350.3 ns 7.18 ns 6.36 ns 1.00 4.87 KB 1.00
Imposter 10 2,062.2 ns 9.52 ns 8.44 ns 0.88 7.97 KB 1.64
Moq 10 226,165.7 ns 1,399.74 ns 1,309.32 ns 96.23 28.64 KB 5.89
NSubstitute 10 22,509.0 ns 58.52 ns 51.88 ns 9.58 25.58 KB 5.26
FakeItEasy 10 24,840.9 ns 79.34 ns 70.33 ns 10.57 32.97 KB 6.77
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.62GHz, 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 Allocated Alloc Ratio
baseline* 1 360.9 ns 8.38 ns 7.84 ns 1.02 2.04 KB 1.00
Mockolate 1 355.5 ns 1.74 ns 1.46 ns 1.00 2.04 KB 1.00
Imposter 1 531.8 ns 5.35 ns 4.75 ns 1.50 4.04 KB 1.98
TUnitMocks 1 641.7 ns 4.33 ns 4.05 ns 1.80 2.9 KB 1.42
Moq 1 186,993.2 ns 360.54 ns 301.07 ns 525.95 14.73 KB 7.23
NSubstitute 1 5,685.3 ns 29.60 ns 27.68 ns 15.99 9.06 KB 4.44
FakeItEasy 1 5,916.3 ns 19.74 ns 18.47 ns 16.64 8.05 KB 3.95
baseline* 10 639.3 ns 1.46 ns 1.37 ns 0.97 2.25 KB 1.00
Mockolate 10 657.0 ns 3.30 ns 3.09 ns 1.00 2.25 KB 1.00
Imposter 10 1,087.8 ns 6.74 ns 6.30 ns 1.66 5.52 KB 2.45
TUnitMocks 10 1,653.6 ns 6.57 ns 6.15 ns 2.52 4.49 KB 2.00
Moq 10 191,252.9 ns 417.94 ns 349.00 ns 291.09 18.64 KB 8.28
NSubstitute 10 8,551.9 ns 52.55 ns 46.59 ns 13.02 11.52 KB 5.12
FakeItEasy 10 9,502.7 ns 94.78 ns 88.66 ns 14.46 15.42 KB 6.85
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.82GHz, 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

Property N Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 1 488.6 ns 4.22 ns 3.74 ns 0.88 2.46 KB 1.00
Mockolate 1 553.5 ns 10.19 ns 9.53 ns 1.00 2.46 KB 1.00
Imposter 1 474.2 ns 12.59 ns 11.78 ns 0.86 3.13 KB 1.27
TUnitMocks 1 751.1 ns 10.67 ns 9.98 ns 1.36 2.51 KB 1.02
Moq 1 12,728.1 ns 89.43 ns 83.65 ns 23.00 10.38 KB 4.22
NSubstitute 1 7,571.2 ns 52.76 ns 46.77 ns 13.68 11.45 KB 4.65
FakeItEasy 1 8,634.3 ns 54.75 ns 51.21 ns 15.60 11.24 KB 4.57
baseline* 10 977.5 ns 3.03 ns 2.53 ns 0.90 2.95 KB 1.00
Mockolate 10 1,088.7 ns 9.31 ns 8.71 ns 1.00 2.95 KB 1.00
Imposter 10 1,244.0 ns 26.87 ns 23.82 ns 1.14 4.67 KB 1.58
TUnitMocks 10 2,203.2 ns 20.00 ns 18.71 ns 2.02 4.66 KB 1.58
Moq 10 19,578.6 ns 68.99 ns 64.54 ns 17.99 17.14 KB 5.80
NSubstitute 10 17,159.9 ns 110.15 ns 97.64 ns 15.76 21.08 KB 7.14
FakeItEasy 10 21,326.7 ns 138.30 ns 129.37 ns 19.59 30.81 KB 10.43
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
Intel Xeon Platinum 8370C CPU 2.80GHz (Max: 3.25GHz), 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-v4

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

Callback Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 328.6 ns 5.38 ns 5.03 ns 0.85 1.68 KB 1.00
Mockolate 386.3 ns 4.71 ns 4.41 ns 1.00 1.68 KB 1.00
Imposter 495.5 ns 6.83 ns 6.39 ns 1.28 2.38 KB 1.42
TUnitMocks 731.8 ns 4.44 ns 3.93 ns 1.89 2.63 KB 1.56
Moq 71,673.1 ns 441.23 ns 412.73 ns 185.55 8.88 KB 5.28
NSubstitute 4,398.8 ns 18.00 ns 16.84 ns 11.39 7.74 KB 4.61
FakeItEasy 4,745.2 ns 22.75 ns 21.28 ns 12.28 6.8 KB 4.05

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

Static abstract interface members cannot be called via the interface
itself, so the prior snippet's verifications would fail in a real test.
Add an act step that calls each member through generic helpers
constrained to IChocolateFactory, including an explicit subscription
before raising and verifying the event.
@sonarqubecloud
Copy link
Copy Markdown

@vbreuss vbreuss merged commit ac5d004 into main May 10, 2026
17 checks passed
@vbreuss vbreuss deleted the docs/static-interface-members-example branch May 10, 2026 11:36
github-actions Bot added a commit that referenced this pull request May 10, 2026
github-actions Bot added a commit that referenced this pull request May 10, 2026
@github-actions
Copy link
Copy Markdown

This is addressed in release v3.2.0.

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

Labels

documentation Improvements or additions to documentation state: released The issue is released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants