Skip to content

Commit

Permalink
fix: test was not correctly checking for offline server
Browse files Browse the repository at this point in the history
  • Loading branch information
uweeby committed Apr 21, 2021
1 parent 5eb58eb commit e913004
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Assets/Tests/Runtime/ClientServer/ServerObjectManagerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ public class ServerObjectManagerTests : ClientServerSetup<MockComponent>
[Test]
public void SpawnObjectExposeExceptionTest()
{
var gameObject = new GameObject();
ServerObjectManager comp = gameObject.AddComponent<ServerObjectManager>();

var obj = new GameObject();

server.Disconnect();

InvalidOperationException ex = Assert.Throws<InvalidOperationException>(() =>
{
comp.SpawnObject(obj, connectionToServer);
serverObjectManager.SpawnObject(new GameObject(), connectionToServer);
});

Assert.That(ex.Message, Is.EqualTo("SpawnObject for " + obj + ", NetworkServer is not active. Cannot spawn objects without an active server."));
Expand Down

0 comments on commit e913004

Please sign in to comment.