Fluent Assertions 8 compatibility#37
Open
drew-cooper wants to merge 7 commits into
Open
Conversation
- Update TargetFrameworks to match FA8: net47;net6.0;netstandard2.0;netstandard2.1 (drop EOL net5.0, netcoreapp3.1, net472, net48) - Bump FluentAssertions 6.5.0 → 8.10.0 - Bump Autofac 6.3.0 → 7.1.0 (last version supporting netstandard2.0) - Bump GitVersion.MsBuild 5.8.1 → 6.0.2 - Update test/sample projects to net8.0, bump all test package versions - Update global.json SDK floor to 8.0.100 - Update CI workflow: actions v4, Java 21, .NET 8/9 SDKs - Update copyright year to 2026 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
FA8 changed ReferenceTypeAssertions to require an AssertionChain parameter. All assertion classes and their constructors are updated accordingly: - All classes: add AssertionChain assertionChain to constructor, pass to base(subject, assertionChain) - All factory methods (Have, Resolve, Registered, etc.): pass CurrentAssertionChain to child assertion objects - AutofacAssertionExtensions: entry points use AssertionChain.GetOrCreate() - ResolveAssertions: replace Execute.Assertion (removed in FA8) with CurrentAssertionChain - BuilderAssertions: same Execute.Assertion replacement - TypeScanningAssertions: thread chain through Where/Except; replace Subject.Should().Have() with direct constructor call to avoid creating a secondary chain - Update test/sample TargetFramework to net10.0 to match installed runtime All 45 tests pass (39 unit + 6 sample). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Set next-version: 8.0.0 in GitVersion.yml so CI targets 8.0.0 series - Add fallback <Version>8.0.0-pre.1</Version> to solution.targets for local/sandbox builds where GitVersion cannot run (CI overrides this) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
global.json floors the SDK at 8.0.100, so the runner installs .NET 8 and only has the .NET 8 runtime. The _build.exe was compiled for net6.0 which is not present, causing the CI run to fail immediately. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Nuke 6.x uses BinaryFormatter for deep-cloning tool settings objects (SettingsEntityExtensions.NewInstance). BinaryFormatter is permanently disabled in .NET 8, causing a NotSupportedException the moment any .SetXxx() fluent call is made on a settings object. Nuke 7+ rewrote settings cloning without BinaryFormatter. Changes: - Bump Nuke.Common 6.0.1 → 8.1.4 - Bump GitVersion.Tool download 5.8.1 → 6.0.2 (match MsBuild task) - Remove [CheckBuildProjectConfigurations] (removed in Nuke 7) - Fix DeleteDirectory: static FileSystemTasks call → AbsolutePath extension Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
windows-latest does not have .NET 10; use net8.0 which is pre-installed. Also align the Framework constant in Build.cs to net8.0 so dotnet test --framework matches the test project's TFM. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GitVersion.MsBuild 6.0.2 only ships net6.0/net8.0 tool binaries; building netstandard2.0, netstandard2.1, and net47 TFMs fails with MSB3073 because tools/<tfm>/gitversion.dll doesn't exist. The Nuke build already injects version properties via --property:AssemblyVersion etc., so the package reference is redundant. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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.
Summary
Resolves issue #36
TargetFrameworksto match FA8 (net47;net6.0;netstandard2.0;netstandard2.1), drop EOLnet5.0/netcoreapp3.1/net472/net48; bump FluentAssertions6.5.0 → 8.10.0, Autofac6.3.0 → 7.1.0(last version supportingnetstandard2.0), GitVersion.MsBuild5.8.1 → 6.0.2; update SDK floor to 8.0.100; bump all test package versions.AssertionChainthrough all assertion classes — FA8 changedReferenceTypeAssertionsto require it in the constructor. Entry points useAssertionChain.GetOrCreate(); child objects receiveCurrentAssertionChain. Replace the removedExecute.AssertionAPI inResolveAssertionsandBuilderAssertions.next-version: 8.0.0inGitVersion.yml; add fallback<Version>8.0.0-pre.1</Version>for local builds where GitVersion cannot run.Test plan
dotnet build FluentAssertions.Autofac/FluentAssertions.Autofac.csproj -f net6.0— succeedsdotnet test FluentAssertions.Autofac.Tests/FluentAssertions.Autofac.Tests.csproj— 39 passeddotnet test SampleLib/SampleLib.csproj— 6 passed8.0.0-pre.1(or GitVersion-derived equivalent)🤖 Generated with Claude Code