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<Func<T, bool>>; 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 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-25 18:10:19 +02:00
commit 7a76b89a94
2 changed files with 4 additions and 2 deletions

View file

@ -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]

View file

@ -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]