mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkServerTest: Send_ServerToClientMessage
This commit is contained in:
parent
764cd988c5
commit
185468ea38
@ -326,6 +326,25 @@ public void Send_ClientToServerMessage()
|
||||
Assert.That(called, Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Send_ServerToClientMessage()
|
||||
{
|
||||
// register a message handler
|
||||
int called = 0;
|
||||
NetworkClient.RegisterHandler<TestMessage1>(msg => ++called, false);
|
||||
|
||||
// listen & connect a client
|
||||
NetworkServer.Listen(1);
|
||||
ConnectClientBlocking(out NetworkConnectionToClient connectionToClient);
|
||||
|
||||
// send message & process
|
||||
connectionToClient.Send(new TestMessage1());
|
||||
ProcessMessages();
|
||||
|
||||
// did it get through?
|
||||
Assert.That(called, Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void OnDataReceivedInvalidConnectionId()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user