Skip to content

feat: create pre-release version for 2.0 major update#79

Merged
vbreuss merged 4 commits into
mainfrom
topic/prepare-for-2.0-release
Mar 22, 2026
Merged

feat: create pre-release version for 2.0 major update#79
vbreuss merged 4 commits into
mainfrom
topic/prepare-for-2.0-release

Conversation

@vbreuss
Copy link
Copy Markdown
Member

@vbreuss vbreuss commented Mar 22, 2026

Updates the Mockolate integration to align with the 2.0 pre-release API and refreshes assertions/tests accordingly, as part of the upcoming 2.0 major update.

Key Changes:

  • Bump dependencies (Mockolate to 2.0.0-pre.2, aweXpect to 2.31.0).
  • Migrate tests to the new mock creation/setup/verify API (CreateMock(), sut.Mock.Setup, sut.Mock.Verify) and update expected failure messages.
  • Update Mockolate-related assertion helpers (notably Then signature and mock description plumbing).
  • Update README documentation.

@vbreuss vbreuss self-assigned this Mar 22, 2026
@vbreuss vbreuss added breaking change The changes require a new major version enhancement New feature or request labels Mar 22, 2026
Copilot AI review requested due to automatic review settings March 22, 2026 08:20
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 22, 2026

Test Results

    8 files  ±0      8 suites  ±0   38s ⏱️ -8s
  189 tests ±0    188 ✅ ±0  1 💤 ±0  0 ❌ ±0 
1 256 runs  ±0  1 255 ✅ ±0  1 💤 ±0  0 ❌ ±0 

Results for commit 5649c63. ± Comparison against base commit b4c0e31.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 22, 2026

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.3 LTS (Noble Numbat)
AMD EPYC 7763 2.78GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.201
[Host] : .NET 10.0.5 (10.0.5, 10.0.526.15411), X64 RyuJIT x86-64-v3
DefaultJob : .NET 10.0.5 (10.0.5, 10.0.526.15411), X64 RyuJIT x86-64-v3

Method Mean Error StdDev Median Allocated
Dummy_aweXpect 0.0006 ns 0.0014 ns 0.0012 ns 0.0 ns -

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 Mockolate integration to align with the 2.0 pre-release API and refreshes assertions/tests accordingly, as part of the upcoming 2.0 major update.

Changes:

  • Bump dependencies (Mockolate to 2.0.0-pre.2, aweXpect to 2.31.0).
  • Migrate tests to the new mock creation/setup/verify API (CreateMock(), sut.Mock.Setup, sut.Mock.Verify) and update expected failure messages.
  • Update Mockolate-related assertion helpers (notably Then signature and mock description plumbing).

Reviewed changes

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

Show a summary per file
File Description
Tests/aweXpect.Mockolate.Tests/Web/ItExtensionsTests.HttpContentTests.IsJsonContentTests.cs Switch HttpClient mocking/setup/verify to the new Mockolate 2.x API surface.
Tests/aweXpect.Mockolate.Tests/ThatVerificationResultIs.TwiceTests.cs Migrate verification tests to CreateMock() + sut.Mock.Verify and adjust expected messages.
Tests/aweXpect.Mockolate.Tests/ThatVerificationResultIs.TimesTests.cs Same migration for predicate-based Times assertions and message expectations.
Tests/aweXpect.Mockolate.Tests/ThatVerificationResultIs.ThenTests.cs Update Then usage to the new delegate shape and adjust interaction text expectations.
Tests/aweXpect.Mockolate.Tests/ThatVerificationResultIs.OnceTests.cs Update mock creation/verification API usage and expected outputs.
Tests/aweXpect.Mockolate.Tests/ThatVerificationResultIs.NeverTests.cs Update mock creation/verification API usage and expected outputs.
Tests/aweXpect.Mockolate.Tests/ThatVerificationResultIs.ExactlyTests.cs Update mock creation/verification API usage and expected outputs.
Tests/aweXpect.Mockolate.Tests/ThatVerificationResultIs.BetweenTests.cs Update mock creation/verification API usage and expected outputs.
Tests/aweXpect.Mockolate.Tests/ThatVerificationResultIs.AtMostTwiceTests.cs Update mock creation/verification API usage and expected outputs.
Tests/aweXpect.Mockolate.Tests/ThatVerificationResultIs.AtMostTests.cs Update mock creation/verification API usage and expected outputs.
Tests/aweXpect.Mockolate.Tests/ThatVerificationResultIs.AtMostOnceTests.cs Update mock creation/verification API usage and expected outputs.
Tests/aweXpect.Mockolate.Tests/ThatVerificationResultIs.AtLeastTwiceTests.cs Update mock creation/verification API usage and expected outputs.
Tests/aweXpect.Mockolate.Tests/ThatVerificationResultIs.AtLeastTests.cs Update mock creation/verification API usage and expected outputs.
Tests/aweXpect.Mockolate.Tests/ThatVerificationResultIs.AtLeastOnceTests.cs Update mock creation/verification API usage and expected outputs.
Tests/aweXpect.Mockolate.Tests/ThatMockVerifyIs.AllSetupsAreUsedTests.cs Migrate verify-object assertions to sut.Mock.Verify and update expected setup reporting.
Tests/aweXpect.Mockolate.Tests/ThatMockVerifyIs.AllInteractionsAreVerifiedTests.cs Migrate verify-object assertions to sut.Mock.Verify and update expected interaction reporting.
Tests/aweXpect.Mockolate.Api.Tests/Expected/aweXpect.Mockolate_netstandard2.0.txt Update public API snapshot (changed Then signature).
Tests/aweXpect.Mockolate.Api.Tests/Expected/aweXpect.Mockolate_net8.0.txt Update public API snapshot (changed Then signature).
Tests/aweXpect.Mockolate.Api.Tests/Expected/aweXpect.Mockolate_net10.0.txt Update public API snapshot (changed Then signature).
Source/aweXpect.Mockolate/ThatVerificationResult.cs Update mock description extraction for verification result assertions (now threading IMock into describer).
Source/aweXpect.Mockolate/ThatVerificationResult.Times.cs Same mock description extraction changes for Times.
Source/aweXpect.Mockolate/ThatVerificationResult.Then.cs Update Then API and implementation to match new verification object shape; adjust describable subject plumbing.
Source/aweXpect.Mockolate/ThatVerificationResult.Between.cs Same mock description extraction changes for Between.
Source/aweXpect.Mockolate/ThatMockVerify.AllSetupsAreUsed.cs Reimplement unused-setup check against registrations and update describable subject plumbing.
Source/aweXpect.Mockolate/ThatMockVerify.AllInteractionsAreVerified.cs Reimplement unverified-interaction check against registrations and update describable subject plumbing.
Source/aweXpect.Mockolate/Helpers/MyDescribableSubject.cs Redefine how mock subjects are described in assertion messages (now based on IMock.ToString()).
Directory.Packages.props Dependency version bumps for the pre-release update.
Comments suppressed due to low confidence (2)

Source/aweXpect.Mockolate/ThatMockVerify.AllInteractionsAreVerified.cs:83

  • TryGetValue always returns an IDescribableSubject, even when Actual as IMock is null. In that case the description falls back to a raw type name (and may omit "… mock"), which makes failures harder to understand. Only provide MyDescribableSubject when the IMock cast succeeds; otherwise fall back to base.TryGetValue.
		public override bool TryGetValue<TValue>([NotNullWhen(true)] out TValue? value) where TValue : default
		{
			if (typeof(TValue) == typeof(IDescribableSubject) &&
			    new MyDescribableSubject<TVerify>(Actual as IMock) is TValue describableSubject)
			{
				value = describableSubject;
				return true;
			}

Source/aweXpect.Mockolate/ThatMockVerify.AllSetupsAreUsed.cs:83

  • TryGetValue always returns an IDescribableSubject, even when Actual as IMock is null. In that case the description falls back to a raw type name (and may omit "… mock"), which makes failures harder to understand. Only provide MyDescribableSubject when the IMock cast succeeds; otherwise fall back to base.TryGetValue.
		public override bool TryGetValue<TValue>([NotNullWhen(true)] out TValue? value) where TValue : default
		{
			if (typeof(TValue) == typeof(IDescribableSubject) &&
			    new MyDescribableSubject<TVerify>(Actual as IMock) is TValue describableSubject)
			{
				value = describableSubject;
				return true;
			}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Source/aweXpect.Mockolate/ThatVerificationResult.Then.cs
Comment thread Source/aweXpect.Mockolate/Helpers/MyDescribableSubject.cs Outdated
Copilot AI review requested due to automatic review settings March 22, 2026 08:29
@vbreuss vbreuss force-pushed the topic/prepare-for-2.0-release branch from 5649276 to 05a55a0 Compare March 22, 2026 08:30
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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md
@vbreuss vbreuss enabled auto-merge (squash) March 22, 2026 08:42
@sonarqubecloud
Copy link
Copy Markdown

@vbreuss vbreuss merged commit 9704882 into main Mar 22, 2026
12 checks passed
@vbreuss vbreuss deleted the topic/prepare-for-2.0-release branch March 22, 2026 08:44
@github-actions
Copy link
Copy Markdown

This is addressed in release v2.0.0.

@github-actions github-actions Bot added the state: released The issue is released label Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change The changes require a new major version enhancement New feature or request state: released The issue is released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants