From 7a76b89a94a9982d9b714b70fc2171838b858260 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 25 Sep 2026 18:10:19 +0200 Subject: [PATCH] Fix expression-tree-incompatible test lambdas for FluentAssertions OnlyContain Two spots failed to build: a method-group reference to float.IsFinite and an `is 1 or 2` pattern inside a lambda that FluentAssertions compiles as an Expression>; expression trees can't contain pattern-matching `is`, and a method group isn't implicitly convertible to an expression tree either. Rewritten as explicit lambdas with `==`/`||`. Co-Authored-By: Claude Sonnet 5 --- tests/GameCult.Geometry.Tests/QuadNormalsTests.cs | 2 +- tests/GameCult.Geometry.Tests/SurfaceNetsTests.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/GameCult.Geometry.Tests/QuadNormalsTests.cs b/tests/GameCult.Geometry.Tests/QuadNormalsTests.cs index ba4026fb..e7c2489b 100644 --- a/tests/GameCult.Geometry.Tests/QuadNormalsTests.cs +++ b/tests/GameCult.Geometry.Tests/QuadNormalsTests.cs @@ -87,7 +87,7 @@ namespace GameCult.Geometry.Tests normals.Should().HaveCount(15); normals.Should().OnlyContain(value => value == 0f); - normals.Should().OnlyContain(float.IsFinite); + normals.Should().OnlyContain(value => float.IsFinite(value)); } [Test] diff --git a/tests/GameCult.Geometry.Tests/SurfaceNetsTests.cs b/tests/GameCult.Geometry.Tests/SurfaceNetsTests.cs index fcf5bfa4..9b846ad1 100644 --- a/tests/GameCult.Geometry.Tests/SurfaceNetsTests.cs +++ b/tests/GameCult.Geometry.Tests/SurfaceNetsTests.cs @@ -207,7 +207,9 @@ namespace GameCult.Geometry.Tests // interior y,z in {1,2} have all four surrounding cells, so only 4 quads are emitted. mesh.QuadCount.Should().Be(4); mesh.QuadEdges.Should().OnlyContain(edge => - edge.X == 1 && edge.Axis == 0 && edge.Y is 1 or 2 && edge.Z is 1 or 2); + edge.X == 1 && edge.Axis == 0 && + (edge.Y == 1 || edge.Y == 2) && + (edge.Z == 1 || edge.Z == 2)); } [Test]