MessagingTests WithTwoClientsWhenOneClientMessagesTheServerItIsEchoedToTheOtherClient Method Delta Engine Documentation

Namespace: DeltaEngine.Networking.Tests
Assembly: DeltaEngine.Networking.Tests (in DeltaEngine.Networking.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void WithTwoClientsWhenOneClientMessagesTheServerItIsEchoedToTheOtherClient()
Examples

[Test, CloseAfterFirstFrame]
public void WithTwoClientsWhenOneClientMessagesTheServerItIsEchoedToTheOtherClient()
{
    if (!StackTraceExtensions.IsStartedFromNCrunch())
        return; //ncrunch: no coverage 
    var clientSession2 = Messaging.JoinSession(Address, Port);
    clientSession2.SendMessage("welcome");
    List<MessagingSession.Message> messages = clientSession.GetMessages();
    Assert.AreEqual(1, serverSession.GetMessages().Count);
    Assert.AreEqual(1, messages.Count);
    VerifyMessageContents(messages[0], 2, "welcome");
    Assert.AreEqual(2, serverSession.NumberOfParticipants);
}
See Also