Repository navigation
Move to FluentAssertions 7.2.2 (supersedes #74) - #79
Merged
Merged
Conversation
Supersedes Dependabot's #74, which only changed the version and so did not compile. The FA 5 -> 7 breaking changes handled: - BeCloseTo(DateTime/TimeSpan) no longer has a default precision. FA 5's was 20 ms, now passed explicitly, so the tolerance is unchanged; the AudioTagService int-milliseconds overload becomes a TimeSpan. - Dictionary ContainKey(...).WhichValue is now WhoseValue. - Equivalency member selection: ctx.SelectedMemberInfo.MemberType is now ctx.Type (IMemberInfo). Two kinds of assertion were vacuous under FA 5 and now actually assert: - DirectoryLookupServiceFixture compared FileSystemModel objects with a string via the untyped NotContain(object), which could never match. They now check by Name, as the neighbouring test already did. - DiskTransferServiceFixture called count.Should().Equals(n), which was object.Equals with the result discarded. FA 7 throws on it; they are now Be(n). All six hold. Stops at 7.x deliberately: 8.0 moved from Apache 2.0 to a paid Xceed licence for commercial use; 7 stays Apache 2.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mc9NtcmUxyduV9MXp6soqX
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.
Supersedes #74. That PR only bumped the version, so the test projects didn't compile. This one also does the FA 5 → 7 migration.
Changes
src/Directory.Packages.props: FluentAssertions 5.10.3 → 7.2.2.BeCloseToprecision: FA 7 has no default precision. FA 5's default was 20 ms, which is now passed explicitly, so the tolerance doesn't change (RateLimitServiceFixture,BasicRepositoryFixture,AlbumRepositoryFixture). InAudioTagServiceFixture, the int-milliseconds overload becomes aTimeSpan.ContainKey(...).WhichValue→WhoseValue(DistanceCalculatorFixture).ctx.SelectedMemberInfo.MemberType→ctx.Type(AlbumRepositoryFixture).Assertions that were silently vacuous under FA 5
DirectoryLookupServiceFixture: two tests comparedFileSystemModelobjects against a string through the untypedNotContain(object), which can never match. They now check byName, as the neighbouring test already did.DiskTransferServiceFixture: sixcount.Should().Equals(n)calls wereobject.Equalswith the result thrown away. FA 7 throws on this. They're nowBe(n).All eight now assert for real and pass.
Why 7.x and not 8
FluentAssertions 8.0 moved from Apache 2.0 to a paid Xceed licence for commercial use. 7.x stays Apache 2.0, and its maintainer has said it will keep getting critical fixes. A separate change should stop Dependabot proposing 8.x.
Tests (local, macOS)
The solution builds with 0 errors. Windows.Test compiles but wasn't run here, so the Windows CI leg is what covers it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Mc9NtcmUxyduV9MXp6soqX