Skip to content

Commit

Permalink
test: updating test for new register logic
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Frowen committed Mar 18, 2024
1 parent b5be86b commit ec40592
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Assets/Tests/Runtime/ClientServer/ClientObjectManagerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,10 @@ public void ThrowsIfPrefabAlreadyRegistered()

clientObjectManager.RegisterPrefab(identity);

var exception = Assert.Throws<InvalidOperationException>(() =>
Assert.DoesNotThrow(() =>
{
clientObjectManager.RegisterSpawnHandler(identity, (msg) => null, (obj) => { });
});

Assert.That(exception, Has.Message.EqualTo($"Prefab with hash {identity.PrefabHash:X} already registered. " +
$"Unregister before adding new or prefabshandlers. Too add Unspawn handler to prefab use RegisterUnspawnHandler instead"));
}, "should not throw if adding handler to prefab that ia already Register");
}

[Test]
Expand Down

0 comments on commit ec40592

Please sign in to comment.