mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkServerTest: RegisterUnregisterClearHandlerTest
This commit is contained in:
parent
212af3fc9d
commit
c2afc05692
@ -712,7 +712,7 @@ public void SendToAllTest()
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RegisterHandlerTest()
|
||||
public void RegisterUnregisterClearHandlerTest()
|
||||
{
|
||||
// message handlers that are needed for the test
|
||||
NetworkServer.RegisterHandler<ConnectMessage>((conn, msg) => {}, false);
|
||||
@ -759,8 +759,10 @@ public void RegisterHandlerTest()
|
||||
LogAssert.ignoreFailingMessages = false;
|
||||
Assert.That(variant1Called, Is.EqualTo(1)); // still 1, not 2
|
||||
|
||||
// unregister second handler, send, should fail
|
||||
NetworkServer.UnregisterHandler<WovenTestMessage>();
|
||||
// unregister second handler via ClearHandlers to test that one too. send, should fail
|
||||
NetworkServer.ClearHandlers();
|
||||
// (only add this one to avoid disconnect error)
|
||||
NetworkServer.RegisterHandler<DisconnectMessage>((conn, msg) => {}, false);
|
||||
writer = new NetworkWriter();
|
||||
MessagePacker.Pack(new TestMessage(), writer);
|
||||
// log error messages are expected
|
||||
|
Loading…
Reference in New Issue
Block a user