This commit is contained in:
vis2k 2021-08-07 13:54:18 +08:00
parent f74fb388b4
commit 98eba5c9c1

View File

@ -201,7 +201,7 @@ public override void TearDown()
[Test]
public void IsServerOnly()
{
CreateNetworked(out GameObject gameObject, out NetworkIdentity identity, out EmptyBehaviour emptyBehaviour);
CreateNetworked(out _, out NetworkIdentity identity, out EmptyBehaviour emptyBehaviour);
// call OnStartServer so isServer is true
identity.OnStartServer();
@ -216,7 +216,7 @@ public void IsServerOnly()
[Test]
public void IsClientOnly()
{
CreateNetworked(out GameObject gameObject, out NetworkIdentity identity, out EmptyBehaviour emptyBehaviour);
CreateNetworked(out _, out NetworkIdentity identity, out EmptyBehaviour emptyBehaviour);
// isClientOnly should be true when isServer = false && isClient = true
identity.isClient = true;
@ -229,14 +229,14 @@ public void IsClientOnly()
public void HasNoAuthorityByDefault()
{
// no authority by default
CreateNetworked(out GameObject gameObject, out NetworkIdentity identity, out EmptyBehaviour emptyBehaviour);
CreateNetworked(out _, out _, out EmptyBehaviour emptyBehaviour);
Assert.That(emptyBehaviour.hasAuthority, Is.False);
}
[Test]
public void HasIdentitysNetId()
{
CreateNetworked(out GameObject gameObject, out NetworkIdentity identity, out EmptyBehaviour emptyBehaviour);
CreateNetworked(out _, out NetworkIdentity identity, out EmptyBehaviour emptyBehaviour);
identity.netId = 42;
Assert.That(emptyBehaviour.netId, Is.EqualTo(42));
}
@ -244,7 +244,7 @@ public void HasIdentitysNetId()
[Test]
public void HasIdentitysConnectionToServer()
{
CreateNetworked(out GameObject gameObject, out NetworkIdentity identity, out EmptyBehaviour emptyBehaviour);
CreateNetworked(out _, out NetworkIdentity identity, out EmptyBehaviour emptyBehaviour);
identity.connectionToServer = new LocalConnectionToServer();
Assert.That(emptyBehaviour.connectionToServer, Is.EqualTo(identity.connectionToServer));
}
@ -252,7 +252,7 @@ public void HasIdentitysConnectionToServer()
[Test]
public void HasIdentitysConnectionToClient()
{
CreateNetworked(out GameObject gameObject, out NetworkIdentity identity, out EmptyBehaviour emptyBehaviour);
CreateNetworked(out _, out NetworkIdentity identity, out EmptyBehaviour emptyBehaviour);
identity.connectionToClient = new LocalConnectionToClient();
Assert.That(emptyBehaviour.connectionToClient, Is.EqualTo(identity.connectionToClient));
}