diff --git a/Assets/Mirror/Tests/Editor/MessagePackerTest.cs b/Assets/Mirror/Tests/Editor/MessagePackerTest.cs index a1f8eee79..393d6573f 100644 --- a/Assets/Mirror/Tests/Editor/MessagePackerTest.cs +++ b/Assets/Mirror/Tests/Editor/MessagePackerTest.cs @@ -22,6 +22,19 @@ public void TestPacking() Assert.That(unpacked.sceneOperation, Is.EqualTo(SceneOperation.LoadAdditive)); } + [Test] + public void UnpackWrongMessage() + { + ConnectMessage message = new ConnectMessage(); + + byte[] data = MessagePacker.Pack(message); + + Assert.Throws(() => + { + DisconnectMessage unpacked = MessagePacker.Unpack(data); + }); + } + [Test] public void TestUnpackIdMismatch() {