diff --git a/Assets/Mirror/Tests/Common/MirrorTest.cs b/Assets/Mirror/Tests/Common/MirrorTest.cs index a673fc9a4..b0ee6c711 100644 --- a/Assets/Mirror/Tests/Common/MirrorTest.cs +++ b/Assets/Mirror/Tests/Common/MirrorTest.cs @@ -182,6 +182,10 @@ protected void CreateNetworkedAndSpawn( NetworkServer.Spawn(serverGO, ownerConnection); ProcessMessages(); + // double check that we have authority if we passed an owner connection + if (ownerConnection != null) + Debug.Assert(clientIdentity.hasAuthority == true, $"Behaviour Had Wrong Authority when spawned, This means that the test is broken and will give the wrong results"); + // make sure the client really spawned it. Assert.That(NetworkClient.spawned.ContainsKey(serverIdentity.netId)); } @@ -235,7 +239,7 @@ protected void CreateNetworkedAndSpawn( // double check that we have authority if we passed an owner connection if (ownerConnection != null) - Debug.Assert(serverComponent.hasAuthority == true, $"Behaviour Had Wrong Authority when spawned, This means that the test is broken and will give the wrong results"); + Debug.Assert(clientComponent.hasAuthority == true, $"Behaviour Had Wrong Authority when spawned, This means that the test is broken and will give the wrong results"); // make sure the client really spawned it. Assert.That(NetworkClient.spawned.ContainsKey(serverIdentity.netId)); @@ -296,8 +300,8 @@ protected void CreateNetworkedAndSpawn( // double check that we have authority if we passed an owner connection if (ownerConnection != null) { - Debug.Assert(serverComponentA.hasAuthority == true, $"Behaviour Had Wrong Authority when spawned, This means that the test is broken and will give the wrong results"); - Debug.Assert(serverComponentB.hasAuthority == true, $"Behaviour Had Wrong Authority when spawned, This means that the test is broken and will give the wrong results"); + Debug.Assert(clientComponentA.hasAuthority == true, $"Behaviour Had Wrong Authority when spawned, This means that the test is broken and will give the wrong results"); + Debug.Assert(clientComponentB.hasAuthority == true, $"Behaviour Had Wrong Authority when spawned, This means that the test is broken and will give the wrong results"); } // make sure the client really spawned it. @@ -362,9 +366,9 @@ protected void CreateNetworkedAndSpawn( // double check that we have authority if we passed an owner connection if (ownerConnection != null) { - Debug.Assert(serverComponentA.hasAuthority == true, $"Behaviour Had Wrong Authority when spawned, This means that the test is broken and will give the wrong results"); - Debug.Assert(serverComponentB.hasAuthority == true, $"Behaviour Had Wrong Authority when spawned, This means that the test is broken and will give the wrong results"); - Debug.Assert(serverComponentC.hasAuthority == true, $"Behaviour Had Wrong Authority when spawned, This means that the test is broken and will give the wrong results"); + Debug.Assert(clientComponentA.hasAuthority == true, $"Behaviour Had Wrong Authority when spawned, This means that the test is broken and will give the wrong results"); + Debug.Assert(clientComponentB.hasAuthority == true, $"Behaviour Had Wrong Authority when spawned, This means that the test is broken and will give the wrong results"); + Debug.Assert(clientComponentC.hasAuthority == true, $"Behaviour Had Wrong Authority when spawned, This means that the test is broken and will give the wrong results"); } // make sure the client really spawned it.