Skip to content

Move to FluentAssertions 7.2.2 (supersedes #74) - #79

Merged
Rorqualx merged 2 commits into
mainfrom
deps/fluentassertions-7
Oct 14, 2026
Merged

Rorqualx merged 2 commits into
mainfrom
deps/fluentassertions-7

Conversation

@Rorqualx

Copy link
Copy Markdown
Owner

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.
  • BeCloseTo precision: 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). In AudioTagServiceFixture, the int-milliseconds overload becomes a TimeSpan.
  • ContainKey(...).WhichValue → WhoseValue (DistanceCalculatorFixture).
  • Equivalency member selection: ctx.SelectedMemberInfo.MemberType → ctx.Type (AlbumRepositoryFixture).

Assertions that were silently vacuous under FA 5

  • DirectoryLookupServiceFixture: two tests compared FileSystemModel objects against a string through the untyped NotContain(object), which can never match. They now check by Name, as the neighbouring test already did.
  • DiskTransferServiceFixture: six count.Should().Equals(n) calls were object.Equals with the result thrown away. FA 7 throws on this. They're now Be(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)

Project Passed Failed Skipped
Core.Test 3457 0 79
Common.Test 610 0 35
Api.Test 192 0 0
Mono.Test 51 0 4
Host.Test 34 0 4
Update.Test 17 0 0
Libraries.Test 1 0 0

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

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
@Rorqualx
Rorqualx merged commit 15420c5 into main Oct 14, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant