From 7b6f1326eb9cfc7c7941f4b7c76cba10d65bff59 Mon Sep 17 00:00:00 2001 From: vis2k Date: Sun, 23 Feb 2020 11:17:17 +0100 Subject: [PATCH] NetworkServertest: LocalClientActiveTest --- Assets/Mirror/Tests/Editor/NetworkServerTest.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Assets/Mirror/Tests/Editor/NetworkServerTest.cs b/Assets/Mirror/Tests/Editor/NetworkServerTest.cs index 76ad301b1..2157d2dc3 100644 --- a/Assets/Mirror/Tests/Editor/NetworkServerTest.cs +++ b/Assets/Mirror/Tests/Editor/NetworkServerTest.cs @@ -150,6 +150,22 @@ public void SetLocalConnectionTest() NetworkServer.Shutdown(); } + [Test] + public void LocalClientActiveTest() + { + // listen + NetworkServer.Listen(1); + Assert.That(NetworkServer.localClientActive, Is.False); + + // set local connection + NetworkServer.SetLocalConnection(new ULocalConnectionToClient()); + Assert.That(NetworkServer.localClientActive, Is.True); + + // shutdown + NetworkServer.Shutdown(); + } + + [Test] public void ShutdownCleanupTest() {