Skip to content

Commit 960000e

Browse files
committed
Update test to expect Log error instead of exception
1 parent 1e64764 commit 960000e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

com.unity.netcode.gameobjects/Tests/Runtime/NetworkSpawnManagerTests.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,9 @@ public void TestClientCantAccessServerPlayer()
6161
return;
6262
}
6363
// client can't access server player
64-
Assert.Throws<NotServerException>(() =>
65-
{
66-
m_ClientNetworkManagers[0].SpawnManager.GetPlayerNetworkObject(serverSideClientId);
67-
});
64+
string expectedLog = $"[Netcode-Server Sender=0] {serverSideClientId} Only the server can find player objects from other clients.";
65+
LogAssert.Expect(UnityEngine.LogType.Error, expectedLog);
66+
m_ClientNetworkManagers[0].SpawnManager.GetPlayerNetworkObject(serverSideClientId);
6867
}
6968

7069
[Test]

0 commit comments

Comments
 (0)