diff options
Diffstat (limited to 'tests/SomhairlesDream.Shared.Tests/ReplayTests.fs')
| -rw-r--r-- | tests/SomhairlesDream.Shared.Tests/ReplayTests.fs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/SomhairlesDream.Shared.Tests/ReplayTests.fs b/tests/SomhairlesDream.Shared.Tests/ReplayTests.fs new file mode 100644 index 0000000..317fabe --- /dev/null +++ b/tests/SomhairlesDream.Shared.Tests/ReplayTests.fs @@ -0,0 +1,26 @@ +namespace SomhairlesDream.Shared.Tests + +open Xunit +open SomhairlesDream.Shared + +module ReplayTests = + [<Fact>] + let ``reconstruction contains three visibly different geometry frames`` () = + let frames = Replay.frames () + + Assert.Equal(3, frames.Length) + Assert.True([| 1; 2; 3 |] = (frames |> Array.map (fun frame -> frame.Version))) + Assert.Equal("重建起点", frames[0].Label) + Assert.Equal("主承力骨架", frames[1].Label) + Assert.Equal("舱段重构", frames[2].Label) + Assert.False(frames[0].Mesh.Vertices = frames[1].Mesh.Vertices) + Assert.False(frames[1].Mesh.Vertices = frames[2].Mesh.Vertices) + + [<Fact>] + let ``mesh snapshots expose indexed triangle buffers`` () = + let mesh = (Replay.frames ()).[2].Mesh + let positions = MeshData.positionData mesh + let indices = MeshData.triangleIndices mesh + + Assert.Equal(mesh.Vertices.Length * 3, positions.Length) + Assert.Equal(45, indices.Length) |
