Skip to content

Commit

Permalink
add Test_EntityStore_CloneEntity_different_store_exception()
Browse files Browse the repository at this point in the history
  • Loading branch information
friflo committed Feb 20, 2025
1 parent cb25ddd commit abe25f5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Tests/ECS/Entity/Test_Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,19 @@ public static void Test_EntityStore_CloneEntity_script_exception()
AreEqual("type: Tests.ECS.TestScript2 - expect: static void CopyScript(TestScript2 source, TestScript2 target)", e!.Message);
}

[Test]
public static void Test_EntityStore_CloneEntity_different_store_exception()
{
var store = new EntityStore();
var store2 = new EntityStore();
var entity = store.CreateEntity();

var e = Throws<ArgumentException>(() => {
store2.CloneEntity(entity);
});
AreEqual("entity is owned by a different store (Parameter 'entity')", e!.Message);
}

[Test]
public static void Test_Entity_EqualityComparer()
{
Expand Down

0 comments on commit abe25f5

Please sign in to comment.