Skip to content

refactor: add TUnit.Mocks to benchmarks#498

Merged
vbreuss merged 2 commits intomainfrom
topic/add-tunit-benchmark
Feb 28, 2026
Merged

refactor: add TUnit.Mocks to benchmarks#498
vbreuss merged 2 commits intomainfrom
topic/add-tunit-benchmark

Conversation

@vbreuss
Copy link
Copy Markdown
Member

@vbreuss vbreuss commented Feb 28, 2026

Adds TUnit.Mocks as an additional mocking library to the benchmark suite so its “happy path” setup/invoke/verify flow can be measured alongside the existing frameworks.

Key Changes:

  • Add central package version for TUnit.Mocks and reference it from the benchmarks project.
  • Introduce a new Simple_TUnitMocks benchmark method in HappyCaseBenchmarks.Simple.cs.

@vbreuss vbreuss self-assigned this Feb 28, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 28, 2026

Test Results

    21 files  ±0      21 suites  ±0   6m 10s ⏱️ +33s
 2 796 tests ±0   2 795 ✅ ±0  1 💤 ±0  0 ❌ ±0 
18 789 runs  ±0  18 788 ✅ ±0  1 💤 ±0  0 ❌ ±0 

Results for commit ae2aed3. ± Comparison against base commit 2b46f32.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 28, 2026

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.3 LTS (Noble Numbat)
AMD EPYC 7763 2.62GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.103
[Host] : .NET 10.0.3 (10.0.3, 10.0.326.7603), 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.491 μs 0.0211 μs 0.0197 μs 0.2460 - 4.02 KB
Simple_Moq 181.023 μs 1.1910 μs 1.0558 μs 0.4883 - 14.55 KB
Simple_NSubstitute 5.735 μs 0.0500 μs 0.0467 μs 0.5569 0.0076 9.14 KB
Simple_FakeItEasy 6.426 μs 0.0481 μs 0.0426 μs 0.4959 - 8.11 KB
Simple_TUnitMocks 2.275 μs 0.0836 μs 0.0782 μs 0.4005 0.0076 6.55 KB

@vbreuss vbreuss marked this pull request as ready for review February 28, 2026 19:36
Copilot AI review requested due to automatic review settings February 28, 2026 19:36
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

Adds TUnit.Mocks as an additional mocking library to the benchmark suite so its “happy path” setup/invoke/verify flow can be measured alongside the existing frameworks.

Changes:

  • Add central package version for TUnit.Mocks and reference it from the benchmarks project.
  • Introduce a new Simple_TUnitMocks benchmark method in HappyCaseBenchmarks.Simple.cs.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
Directory.Packages.props Adds a centrally-managed version entry for TUnit.Mocks (plus a small formatting normalization).
Benchmarks/Mockolate.Benchmarks/Mockolate.Benchmarks.csproj References TUnit.Mocks for use in benchmarks.
Benchmarks/Mockolate.Benchmarks/HappyCaseBenchmarks.Simple.cs Adds a Simple_TUnitMocks benchmark that performs setup, invocation, and verification using TUnit.Mocks.

Comment thread Benchmarks/Mockolate.Benchmarks/HappyCaseBenchmarks.Simple.cs
Comment thread Directory.Packages.props
@vbreuss vbreuss force-pushed the topic/add-tunit-benchmark branch from 368e9e5 to ae2aed3 Compare February 28, 2026 19:39
@vbreuss vbreuss enabled auto-merge (squash) February 28, 2026 19:40
@sonarqubecloud
Copy link
Copy Markdown

@vbreuss vbreuss merged commit c95953c into main Feb 28, 2026
12 checks passed
@vbreuss vbreuss deleted the topic/add-tunit-benchmark branch February 28, 2026 19:45
@github-actions
Copy link
Copy Markdown

This is addressed in release v1.5.0.

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.

2 participants