From 6037e7ac1f9ebab1a9b85b47c16191d24632971e Mon Sep 17 00:00:00 2001 From: vis2k Date: Wed, 16 Jun 2021 11:38:58 +0800 Subject: [PATCH] NetworkServerTest: replace over engineered test --- .../Mirror/Tests/Editor/NetworkServerTest.cs | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/Assets/Mirror/Tests/Editor/NetworkServerTest.cs b/Assets/Mirror/Tests/Editor/NetworkServerTest.cs index b597f1685..dd6b3f375 100644 --- a/Assets/Mirror/Tests/Editor/NetworkServerTest.cs +++ b/Assets/Mirror/Tests/Editor/NetworkServerTest.cs @@ -824,24 +824,17 @@ public void ShutdownCleanup() } [Test] - [TestCase(nameof(NetworkServer.SendToAll))] - [TestCase(nameof(NetworkServer.SendToReady))] - public void SendCalledWhileNotActive_ShouldGiveWarning(string functionName) + public void SendToAll_CalledWhileNotActive_ShouldGiveWarning() { - LogAssert.Expect(LogType.Warning, $"Can not send using NetworkServer.{functionName}(T msg) because NetworkServer is not active"); + LogAssert.Expect(LogType.Warning, $"Can not send using NetworkServer.SendToAll(T msg) because NetworkServer is not active"); + NetworkServer.SendToAll(new NetworkPingMessage {}); + } - switch (functionName) - { - case nameof(NetworkServer.SendToAll): - NetworkServer.SendToAll(new NetworkPingMessage {}); - break; - case nameof(NetworkServer.SendToReady): - NetworkServer.SendToReady(new NetworkPingMessage {}); - break; - default: - Debug.LogError("Could not find function name"); - break; - } + [Test] + public void SendToReady_CalledWhileNotActive_ShouldGiveWarning() + { + LogAssert.Expect(LogType.Warning, $"Can not send using NetworkServer.SendToReady(T msg) because NetworkServer is not active"); + NetworkServer.SendToReady(new NetworkPingMessage {}); } [Test]