public void TestOnSendZeroCountEvent() { Action <NetworkDiagnostics.MessageInfo> outMessageCallback = Substitute.For <Action <NetworkDiagnostics.MessageInfo> >(); NetworkDiagnostics.OutMessageEvent += outMessageCallback; var message = new TestMessage(); NetworkDiagnostics.OnSend(message, Channel.Reliable, 10, 0); outMessageCallback.DidNotReceive(); NetworkDiagnostics.OutMessageEvent -= outMessageCallback; }
public void TestOnSendEvent() { Action <NetworkDiagnostics.MessageInfo> outMessageCallback = Substitute.For <Action <NetworkDiagnostics.MessageInfo> >(); NetworkDiagnostics.OutMessageEvent += outMessageCallback; var message = new TestMessage(); NetworkDiagnostics.OnSend(message, Channel.Reliable, 10, 5); var expected = new NetworkDiagnostics.MessageInfo(message, Channel.Reliable, 10, 5); outMessageCallback.Received(1).Invoke(Arg.Is(expected)); NetworkDiagnostics.OutMessageEvent -= outMessageCallback; }