Add public ValueTypeAssertions<TSubject, TAssertions> base class - #3308
Open
dennisdoomen wants to merge 1 commit into
Open
Add public ValueTypeAssertions<TSubject, TAssertions> base class#3308dennisdoomen wants to merge 1 commit into
dennisdoomen wants to merge 1 commit into
Conversation
dennisdoomen
requested a deployment
to
qodana-pr
August 10, 2026 14:57 — with
GitHub Actions
Waiting
Coverage Report for CI Build 31400945909Warning No base build found for commit Coverage: 97.184%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats💛 - Coveralls |
dennisdoomen
marked this pull request as draft
August 10, 2026 16:59
dennisdoomen
force-pushed
the
dennisdoomen-value-type-assertions-base-class
branch
from
August 15, 2026 10:10
f1a7c19 to
673be2d
Compare
dennisdoomen
requested a deployment
to
qodana-pr
August 15, 2026 10:10 — with
GitHub Actions
Waiting
dennisdoomen
force-pushed
the
dennisdoomen-value-type-assertions-base-class
branch
from
August 15, 2026 12:28
673be2d to
e9db98c
Compare
dennisdoomen
requested a deployment
to
qodana-pr
August 15, 2026 12:28 — with
GitHub Actions
Waiting
dennisdoomen
force-pushed
the
dennisdoomen-value-type-assertions-base-class
branch
from
August 15, 2026 12:29
e9db98c to
6af3dd1
Compare
dennisdoomen
requested a deployment
to
qodana-pr
August 15, 2026 12:29 — with
GitHub Actions
Waiting
Adds a base class for building custom assertions on value types (structs), mirroring ReferenceTypeAssertions for reference types. It provides Be, NotBe, BeNull, NotBeNull and Match, driven by an overridable Identifier property for consistent failure messages. Closes #3292 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
dennisdoomen
force-pushed
the
dennisdoomen-value-type-assertions-base-class
branch
from
August 15, 2026 12:30
6af3dd1 to
6fd822e
Compare
dennisdoomen
marked this pull request as ready for review
August 15, 2026 12:30
Qodana for .NETIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3292
What
Adds a public
ValueTypeAssertions<TSubject, TAssertions>base class inFluentAssertions.Primitives, giving third-party assertion authors a ready-made base for value types (structs), mirroring whatReferenceTypeAssertions<TSubject, TAssertions>already offers for reference types.API
The constructor and
CurrentAssertionChain/WithDefaultIdentifierusage follow the same conventions already used byReferenceTypeAssertions,BooleanAssertions, and the other primitive assertion classes in this codebase, rather than the constructor shape shown in the issue's proposal (which predates theAssertionChainpattern).Changes
Src/FluentAssertions/Primitives/ValueTypeAssertions.cs— new base class.Tests/FluentAssertions.Specs/Primitives/ValueTypeAssertionsSpecs.cs— specs coveringBe,NotBe,BeNull,NotBeNull,Match, and theEqualsguard, using aCoordinatesstruct/CoordinatesAssertionstest fixture.Tests/Approval.Tests/ApprovedApi/**/*.verified.txt— updated viaAcceptApiChanges.ps1for the new public API.docs/_pages/extensibility.md— mentions the new base class alongsideReferenceTypeAssertions.docs/_pages/releases.md— release note entry.Testing
dotnet test Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj --filter "FullyQualifiedName~Primitives"— all pass (net47/net6.0/net8.0).dotnet test Tests/Approval.Tests/Approval.Tests.csproj— all pass after accepting the API change.