diff --git a/src/Flecs.NET.Tests/Cpp/DocTests.cs b/src/Flecs.NET.Tests/Cpp/DocTests.cs index 1c2041f..dada2c3 100644 --- a/src/Flecs.NET.Tests/Cpp/DocTests.cs +++ b/src/Flecs.NET.Tests/Cpp/DocTests.cs @@ -73,7 +73,7 @@ private void SetUuid() Assert.True(e.Has(Ecs.Doc.Uuid)); - Assert.Equal(e.DocUuid(), "81f50b40-09ff-4ce0-a388-4a52a14052c7"); + Assert.Equal("81f50b40-09ff-4ce0-a388-4a52a14052c7", e.DocUuid()); } [Fact] diff --git a/src/Flecs.NET.Tests/Cpp/PairTests.cs b/src/Flecs.NET.Tests/Cpp/PairTests.cs index 46e2b6e..aa723a1 100644 --- a/src/Flecs.NET.Tests/Cpp/PairTests.cs +++ b/src/Flecs.NET.Tests/Cpp/PairTests.cs @@ -1114,4 +1114,57 @@ private void SymmetricWithChildOf() Assert.True(bob.Has(alice)); } + + [Fact] + private void ModifiedTagSecond() + { + using World world = World.Create(); + + int count = 0; + world.Observer() + .TermAt(0).Second() + .Event(Ecs.OnSet) + .Each((ref Position p) => + { + Assert.Equal(10, p.X); + Assert.Equal(20, p.Y); + count++; + }); + + Entity e = world.Entity(); + + ref Position p = ref e.EnsureFirst(); + p.X = 10; + p.Y = 20; + e.Modified(); + + Assert.Equal(1, count); + } + + [Fact] + private void ModifiedTagFirst() + { + using World world = World.Create(); + + int count = 0; + world.Observer() + .With() + .Event(Ecs.OnSet) + .Each((Iter it, int row) => + { + ref Position p = ref it.FieldAt(0, row); + Assert.Equal(10, p.X); + Assert.Equal(20, p.Y); + count++; + }); + + Entity e = world.Entity(); + + ref Position p = ref e.EnsureSecond(); + p.X = 10; + p.Y = 20; + e.Modified(); + + Assert.Equal(1, count); + } }