Refactor BoolExtensions into dedicated BooleanAssertions type#191
Merged
MrKWatkins merged 3 commits intomainfrom Feb 18, 2026
Merged
Conversation
- Create BooleanAssertions class inheriting ObjectAssertions<bool> - Create BooleanAssertionsChain struct for method chaining - Add Should(bool) overload in ShouldExtensions - Move non-nullable bool methods from BooleanExtensions to BooleanAssertions - Keep nullable bool? extension methods in BooleanExtensions - Add BooleanAssertionsTests with tests for new class - Update BooleanExtensionsTests to only test nullable overloads - Update API documentation to reflect new structure Co-authored-by: MrKWatkins <345796+MrKWatkins@users.noreply.github.com>
Co-authored-by: MrKWatkins <345796+MrKWatkins@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor BoolExtensions into BooleanAssertions type
Refactor BoolExtensions into dedicated BooleanAssertions type
Feb 15, 2026
MrKWatkins
approved these changes
Feb 18, 2026
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.
Promotes boolean assertions from extension methods on
ObjectAssertions<bool>to a dedicatedBooleanAssertionsclass, matching theIntegerAssertions<T>pattern.Changes
BooleanAssertions— New sealed class inheritingObjectAssertions<bool>withBeTrue(),NotBeTrue(),BeFalse(),NotBeFalse()returningBooleanAssertionsChainBooleanAssertionsChain— New readonly struct withAndandValueproperties for fluent chainingShouldExtensions— AddedShould(this bool)overload with[OverloadResolutionPriority(1)]returningBooleanAssertionsBooleanExtensions— Stripped to only nullablebool?overloads (still extension methods onObjectAssertions<bool?>)BooleanAssertionsTests(non-nullable) andBooleanExtensionsTests(nullable); added chaining and inherited method testsBefore/After
Also fixed a pre-existing bug in
NotBeTrue's error message — it previously said "was false" when the value was actuallytrue.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.