public void FromMessageWithNonMatchingMessageType() { var translator = new DownloadRequestConverter(); 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 DownloadRequestConverter(); var msg = new DataDownloadRequestMessage(new EndpointId("a"), new UploadToken()); var data = translator.FromMessage(msg); Assert.IsInstanceOf(typeof(DownloadRequestData), data); Assert.AreSame(msg.Id, data.Id); Assert.AreSame(msg.Sender, data.Sender); Assert.AreSame(msg.InResponseTo, data.InResponseTo); Assert.AreSame(msg.Token, ((DownloadRequestData)data).Token); }