Convert all FluentAssertions code to Shouldly#85
Merged
Conversation
Co-authored-by: tknightnd <45595149+tknightnd@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Convert all FluentAssertions code to Shouldly
Convert all FluentAssertions code to Shouldly
Jun 26, 2025
test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkParserTests.cs
Dismissed
Show dismissed
Hide dismissed
test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkParserTests.cs
Dismissed
Show dismissed
Hide dismissed
test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkParserTests.cs
Dismissed
Show dismissed
Hide dismissed
test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkParserTests.cs
Dismissed
Show dismissed
Hide dismissed
test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkParserTests.cs
Dismissed
Show dismissed
Hide dismissed
test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkParserTests.cs
Dismissed
Show dismissed
Hide dismissed
tknightnd
approved these changes
Jun 26, 2025
This was referenced Feb 9, 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.
This PR converts all FluentAssertions usage to Shouldly across both test projects as requested in issue #84.
Changes Made
Package References
FluentAssertions 7.1.0withShouldly 4.2.1in both test projects:BenchmarkDotNetAnalyser.Tests.UnitBenchmarkDotNetAnalyser.Tests.IntegrationCode Conversions
Updated 29 test files across both projects with the following assertion pattern conversions:
.Should().Be(x).ShouldBe(x).Should().BeTrue().ShouldBeTrue().Should().BeFalse().ShouldBeFalse().Should().BeNull().ShouldBeNull().Should().NotBeNull().ShouldNotBeNull().Should().BeEmpty().ShouldBeEmpty().Should().BeGreaterThan(x).ShouldBeGreaterThan(x).Should().NotBeNullOrWhiteSpace().ShouldNotBeNullOrWhiteSpace().Should().Throw<T>().ShouldThrow<T>()Special Handling
Func<T>delegates toActiondelegates for exception assertions since Shouldly requiresActionfor.ShouldThrow<T>().Andchains into separate Shouldly assertions.Valueproperty access for nullable type comparisons where needed.Should().BeInAscendingOrder(x => x.Name)with custom comparison logic using.OrderBy()Verification
✅ All 301 tests pass (258 unit + 43 integration)
✅ Solution builds without errors
✅ No FluentAssertions references remain in test code
Example conversion:
Fixes #84.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.