change Debug.Assert to Assert.That

This commit is contained in:
mischa 2023-10-29 17:53:03 +01:00
parent 2ab395cc85
commit b434d001b1

View File

@ -864,14 +864,14 @@ public void AuthorityIsFalseVariations()
identity.isServer = false; identity.isServer = false;
identity.isOwned = false; identity.isOwned = false;
emptyBehaviour.syncDirection = SyncDirection.ClientToServer; emptyBehaviour.syncDirection = SyncDirection.ClientToServer;
Debug.Assert(!emptyBehaviour.authority, "Client-only isOwned=false syncDirection=ClientToServer should have no authority"); Assert.That(!emptyBehaviour.authority, "Client-only isOwned=false syncDirection=ClientToServer should have no authority");
CreateNetworked(out _, out identity, out emptyBehaviour); CreateNetworked(out _, out identity, out emptyBehaviour);
identity.isClient = true; identity.isClient = true;
identity.isServer = false; identity.isServer = false;
identity.isOwned = false; identity.isOwned = false;
emptyBehaviour.syncDirection = SyncDirection.ServerToClient; emptyBehaviour.syncDirection = SyncDirection.ServerToClient;
Debug.Assert(!emptyBehaviour.authority, "Client-only isOwned=false syncDirection=ServerToClient should have no authority"); Assert.That(!emptyBehaviour.authority, "Client-only isOwned=false syncDirection=ServerToClient should have no authority");
// has no authority as server only // has no authority as server only
CreateNetworked(out _, out identity, out emptyBehaviour); CreateNetworked(out _, out identity, out emptyBehaviour);
@ -879,7 +879,7 @@ public void AuthorityIsFalseVariations()
identity.isServer = true; identity.isServer = true;
identity.isOwned = false; identity.isOwned = false;
emptyBehaviour.syncDirection = SyncDirection.ClientToServer; emptyBehaviour.syncDirection = SyncDirection.ClientToServer;
Debug.Assert(!emptyBehaviour.authority, "Server-only isOwned=false syncDirection=ClientToServer should have no authority"); Assert.That(!emptyBehaviour.authority, "Server-only isOwned=false syncDirection=ClientToServer should have no authority");
// has no authority as host, not owned and client-to-server sync // has no authority as host, not owned and client-to-server sync
CreateNetworked(out _, out identity, out emptyBehaviour); CreateNetworked(out _, out identity, out emptyBehaviour);
@ -887,7 +887,7 @@ public void AuthorityIsFalseVariations()
identity.isServer = true; identity.isServer = true;
identity.isOwned = false; identity.isOwned = false;
emptyBehaviour.syncDirection = SyncDirection.ClientToServer; emptyBehaviour.syncDirection = SyncDirection.ClientToServer;
Debug.Assert(!emptyBehaviour.authority, "Host isOwned=false syncDirection=ClientToServer should have no authority"); Assert.That(!emptyBehaviour.authority, "Host isOwned=false syncDirection=ClientToServer should have no authority");
} }
[Test] [Test]
@ -899,7 +899,7 @@ public void AuthorityIsTrueVariations()
identity.isServer = false; identity.isServer = false;
identity.isOwned = true; identity.isOwned = true;
emptyBehaviour.syncDirection = SyncDirection.ClientToServer; emptyBehaviour.syncDirection = SyncDirection.ClientToServer;
Debug.Assert(emptyBehaviour.authority, "Client-only isOwned=true syncDirection=ClientToServer should have authority"); Assert.That(emptyBehaviour.authority, "Client-only isOwned=true syncDirection=ClientToServer should have authority");
// has authority as server only // has authority as server only
CreateNetworked(out _, out identity, out emptyBehaviour); CreateNetworked(out _, out identity, out emptyBehaviour);
@ -907,7 +907,7 @@ public void AuthorityIsTrueVariations()
identity.isServer = true; identity.isServer = true;
identity.isOwned = false; identity.isOwned = false;
emptyBehaviour.syncDirection = SyncDirection.ServerToClient; emptyBehaviour.syncDirection = SyncDirection.ServerToClient;
Debug.Assert(emptyBehaviour.authority, "Server-only isOwned=false syncDirection=ServerToClient should have authority"); Assert.That(emptyBehaviour.authority, "Server-only isOwned=false syncDirection=ServerToClient should have authority");
// has authority as host, owned and client-to-server sync // has authority as host, owned and client-to-server sync
CreateNetworked(out _, out identity, out emptyBehaviour); CreateNetworked(out _, out identity, out emptyBehaviour);
@ -915,7 +915,7 @@ public void AuthorityIsTrueVariations()
identity.isServer = true; identity.isServer = true;
identity.isOwned = true; identity.isOwned = true;
emptyBehaviour.syncDirection = SyncDirection.ClientToServer; emptyBehaviour.syncDirection = SyncDirection.ClientToServer;
Debug.Assert(emptyBehaviour.authority, "Host isOwned=true syncDirection=ClientToServer should have authority"); Assert.That(emptyBehaviour.authority, "Host isOwned=true syncDirection=ClientToServer should have authority");
// has authority as host, not owned and server-to-client sync // has authority as host, not owned and server-to-client sync
CreateNetworked(out _, out identity, out emptyBehaviour); CreateNetworked(out _, out identity, out emptyBehaviour);
@ -923,7 +923,7 @@ public void AuthorityIsTrueVariations()
identity.isServer = true; identity.isServer = true;
identity.isOwned = false; identity.isOwned = false;
emptyBehaviour.syncDirection = SyncDirection.ServerToClient; emptyBehaviour.syncDirection = SyncDirection.ServerToClient;
Debug.Assert(emptyBehaviour.authority, "Host isOwned=false syncDirection=ServerToClient should have authority"); Assert.That(emptyBehaviour.authority, "Host isOwned=false syncDirection=ServerToClient should have authority");
} }
// test for an issue where nested classes wouldn't be weaved. // test for an issue where nested classes wouldn't be weaved.