mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
test that we cannot unpack the wrong message
This commit is contained in:
parent
a7ab26fa7d
commit
e8c9d7951d
@ -22,6 +22,19 @@ public void TestPacking()
|
|||||||
Assert.That(unpacked.sceneOperation, Is.EqualTo(SceneOperation.LoadAdditive));
|
Assert.That(unpacked.sceneOperation, Is.EqualTo(SceneOperation.LoadAdditive));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void UnpackWrongMessage()
|
||||||
|
{
|
||||||
|
ConnectMessage message = new ConnectMessage();
|
||||||
|
|
||||||
|
byte[] data = MessagePacker.Pack(message);
|
||||||
|
|
||||||
|
Assert.Throws<FormatException>(() =>
|
||||||
|
{
|
||||||
|
DisconnectMessage unpacked = MessagePacker.Unpack<DisconnectMessage>(data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestUnpackIdMismatch()
|
public void TestUnpackIdMismatch()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user