mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix(NetworkServerTest): Updated tests (#3739)
- Expect Errors from PR #3737
This commit is contained in:
parent
e1a1f49d0c
commit
ac050a804d
@ -632,6 +632,7 @@ public void Send_ClientToServerMessage_UnknownMessageIdDisconnects()
|
||||
|
||||
// send a message without a registered handler
|
||||
NetworkClient.Send(new TestMessage1());
|
||||
LogAssert.Expect(LogType.Error, $"NetworkServer: failed to unpack and invoke message. Disconnecting 1.");
|
||||
ProcessMessages();
|
||||
|
||||
// should have been disconnected
|
||||
@ -684,6 +685,7 @@ public void Send_ServerToClientMessage_UnknownMessageIdDisconnects()
|
||||
|
||||
// send a message without a registered handler
|
||||
connectionToClient.Send(new TestMessage1());
|
||||
LogAssert.Expect(LogType.Error, $"NetworkClient: failed to unpack and invoke message. Disconnecting.");
|
||||
ProcessMessages();
|
||||
|
||||
// should have been disconnected
|
||||
@ -866,6 +868,7 @@ public void UnregisterHandler()
|
||||
// unregister, send again, should not be called again
|
||||
NetworkServer.UnregisterHandler<TestMessage1>();
|
||||
NetworkClient.Send(new TestMessage1());
|
||||
LogAssert.Expect(LogType.Error, $"NetworkServer: failed to unpack and invoke message. Disconnecting 1.");
|
||||
ProcessMessages();
|
||||
Assert.That(variant1Called, Is.EqualTo(1));
|
||||
}
|
||||
@ -889,6 +892,7 @@ public void ClearHandler()
|
||||
// clear handlers, send again, should not be called again
|
||||
NetworkServer.ClearHandlers();
|
||||
NetworkClient.Send(new TestMessage1());
|
||||
LogAssert.Expect(LogType.Error, $"NetworkServer: failed to unpack and invoke message. Disconnecting 1.");
|
||||
ProcessMessages();
|
||||
Assert.That(variant1Called, Is.EqualTo(1));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user