feat: create pre-release version for 2.0 major update#79
Conversation
🚀 Benchmark ResultsDetails
|
There was a problem hiding this comment.
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 to2.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
Thensignature 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 IMockis null. In that case the description falls back to a raw type name (and may omit "… mock"), which makes failures harder to understand. Only provideMyDescribableSubjectwhen the IMock cast succeeds; otherwise fall back tobase.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 IMockis null. In that case the description falls back to a raw type name (and may omit "… mock"), which makes failures harder to understand. Only provideMyDescribableSubjectwhen the IMock cast succeeds; otherwise fall back tobase.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.
5649276 to
05a55a0
Compare
There was a problem hiding this comment.
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.
|
|
This is addressed in release v2.0.0. |



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:
2.0.0-pre.2, aweXpect to2.31.0).CreateMock(),sut.Mock.Setup,sut.Mock.Verify) and update expected failure messages.Thensignature and mock description plumbing).