Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Fix CI compile issue and xUnit analyzer warnings in tests

Yuechen Li8f3f72cdaf15
diff --git a/Aetheris.Kernel.Core.Tests/Brep/Features/BrepExtrudeTests.cs b/Aetheris.Kernel.Core.Tests/Brep/Features/BrepExtrudeTests.cs
index cc18b945..eecad4af 100644
--- a/Aetheris.Kernel.Core.Tests/Brep/Features/BrepExtrudeTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Brep/Features/BrepExtrudeTests.cs
@@ -23,7 +23,7 @@ public sealed class BrepExtrudeTests
var body = result.Value;
Assert.Single(body.Topology.Bodies);
- Assert.Equal(1, body.Topology.Shells.Count());
+ Assert.Single(body.Topology.Shells);
Assert.Equal(6, body.Topology.Faces.Count());
Assert.Equal(6, body.Topology.Loops.Count());
Assert.Equal(24, body.Topology.Coedges.Count());
diff --git a/Aetheris.Kernel.Core.Tests/Brep/Features/BrepRevolveTests.cs b/Aetheris.Kernel.Core.Tests/Brep/Features/BrepRevolveTests.cs
index 74f6386d..7878f194 100644
--- a/Aetheris.Kernel.Core.Tests/Brep/Features/BrepRevolveTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Brep/Features/BrepRevolveTests.cs
@@ -32,7 +32,7 @@ public sealed class BrepRevolveTests
var body = result.Value;
Assert.Single(body.Topology.Bodies);
- Assert.Equal(1, body.Topology.Shells.Count());
+ Assert.Single(body.Topology.Shells);
Assert.Equal(3, body.Topology.Faces.Count());
Assert.Equal(3, body.Topology.Loops.Count());
Assert.Equal(6, body.Topology.Coedges.Count());
diff --git a/Aetheris.Kernel.Core.Tests/Brep/HardeningRandomizedStressTests.cs b/Aetheris.Kernel.Core.Tests/Brep/HardeningRandomizedStressTests.cs
index af2b4843..4c69a09a 100644
--- a/Aetheris.Kernel.Core.Tests/Brep/HardeningRandomizedStressTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Brep/HardeningRandomizedStressTests.cs
@@ -70,7 +70,7 @@ public sealed class HardeningRandomizedStressTests
if (!Direction3D.TryCreate(directionVector, out var direction))
{
- direction = Direction3D.XAxis;
+ direction = Direction3D.Create(new Vector3D(1d, 0d, 0d));
}
var ray = new Ray3D(origin, direction);
diff --git a/Aetheris.Kernel.Core.Tests/Brep/Picking/BrepPickerTests.cs b/Aetheris.Kernel.Core.Tests/Brep/Picking/BrepPickerTests.cs
index a46b52fd..a5b42536 100644
--- a/Aetheris.Kernel.Core.Tests/Brep/Picking/BrepPickerTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Brep/Picking/BrepPickerTests.cs
@@ -19,7 +19,7 @@ public sealed class BrepPickerTests
var result = BrepPicker.Pick(box, tessellation, ray);
Assert.True(result.IsSuccess);
- var firstFaceHit = Assert.Single(result.Value.Where(h => h.EntityKind == SelectionEntityKind.Face));
+ var firstFaceHit = Assert.Single(result.Value, h => h.EntityKind == SelectionEntityKind.Face);
Assert.Equal(new FaceId(2), firstFaceHit.FaceId);
Assert.Equal(2d, firstFaceHit.T, 8);
Assert.Equal(0d, firstFaceHit.Point.X, 8);
@@ -71,8 +71,8 @@ public sealed class BrepPickerTests
Assert.True(culled.IsSuccess);
Assert.True(includeBackfaces.IsSuccess);
- Assert.Empty(culled.Value.Where(h => h.EntityKind == SelectionEntityKind.Face));
- Assert.NotEmpty(includeBackfaces.Value.Where(h => h.EntityKind == SelectionEntityKind.Face));
+ Assert.DoesNotContain(culled.Value, h => h.EntityKind == SelectionEntityKind.Face);
+ Assert.Contains(includeBackfaces.Value, h => h.EntityKind == SelectionEntityKind.Face);
}
[Fact]
@@ -104,7 +104,7 @@ public sealed class BrepPickerTests
var result = BrepPicker.Pick(box, tessellation, ray, PickQueryOptions.Default with { EdgeTolerance = 0.005d });
Assert.True(result.IsSuccess);
- Assert.Empty(result.Value.Where(h => h.EntityKind == SelectionEntityKind.Edge));
+ Assert.DoesNotContain(result.Value, h => h.EntityKind == SelectionEntityKind.Edge);
}
[Fact]
diff --git a/Aetheris.Kernel.Core.Tests/Brep/Primitives/BrepPrimitivesTests.cs b/Aetheris.Kernel.Core.Tests/Brep/Primitives/BrepPrimitivesTests.cs
index ceebf743..31651421 100644
--- a/Aetheris.Kernel.Core.Tests/Brep/Primitives/BrepPrimitivesTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Brep/Primitives/BrepPrimitivesTests.cs
@@ -15,7 +15,7 @@ public sealed class BrepPrimitivesTests
var body = result.Value;
Assert.Single(body.Topology.Bodies);
- Assert.Equal(1, body.Topology.Shells.Count());
+ Assert.Single(body.Topology.Shells);
Assert.Equal(6, body.Topology.Faces.Count());
Assert.Equal(6, body.Topology.Loops.Count());
Assert.Equal(24, body.Topology.Coedges.Count());
@@ -64,7 +64,7 @@ public sealed class BrepPrimitivesTests
var body = result.Value;
Assert.Single(body.Topology.Bodies);
- Assert.Equal(1, body.Topology.Shells.Count());
+ Assert.Single(body.Topology.Shells);
Assert.Equal(3, body.Topology.Faces.Count());
Assert.Equal(3, body.Topology.Edges.Count());
@@ -117,8 +117,8 @@ public sealed class BrepPrimitivesTests
var body = result.Value;
Assert.Single(body.Topology.Bodies);
- Assert.Equal(1, body.Topology.Shells.Count());
- Assert.Equal(1, body.Topology.Faces.Count());
+ Assert.Single(body.Topology.Shells);
+ Assert.Single(body.Topology.Faces);
Assert.Empty(body.Topology.Loops);
Assert.Empty(body.Topology.Edges);
Assert.Empty(body.Topology.Vertices);