public void FromMessageWithNonMatchingMessageType() { var translator = new EndpointDisconnectConverter(); var msg = new SuccessMessage(new EndpointId("a"), new MessageId()); var data = translator.FromMessage(msg); Assert.IsInstanceOf(typeof(UnknownMessageTypeData), data); Assert.AreSame(msg.Id, data.Id); Assert.AreSame(msg.Sender, data.Sender); Assert.AreSame(msg.InResponseTo, data.InResponseTo); }
public void FromMessage() { var translator = new EndpointDisconnectConverter(); var msg = new EndpointDisconnectMessage(new EndpointId("a"), "b"); var data = translator.FromMessage(msg); Assert.IsInstanceOf(typeof(EndpointDisconnectData), data); Assert.AreSame(msg.Id, data.Id); Assert.AreSame(msg.Sender, data.Sender); Assert.AreSame(msg.InResponseTo, data.InResponseTo); Assert.AreSame(msg.ClosingReason, ((EndpointDisconnectData)data).DisconnectReason); }