public void FromMessageWithNonMatchingMessageType()
        {
            var translator = new EndpointInteractionInformationResponseConverter();

            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 EndpointInteractionInformationResponseConverter();

            var msg = new EndpointInteractionInformationResponseMessage(
                new EndpointId("a"),
                new MessageId(),
                InteractionConnectionState.Denied);
            var data = translator.FromMessage(msg);

            Assert.IsInstanceOf(typeof(EndpointInteractionInformationResponseData), data);
            Assert.AreSame(msg.Id, data.Id);
            Assert.AreSame(msg.Sender, data.Sender);
            Assert.AreSame(msg.InResponseTo, data.InResponseTo);
            Assert.AreEqual(msg.State.ToString(), ((EndpointInteractionInformationResponseData)data).State);
        }
        public void ToMessageWithNonMatchingDataType()
        {
            var translator = new EndpointInteractionInformationResponseConverter();

            var data = new SuccessData
            {
                Id           = new MessageId(),
                InResponseTo = new MessageId(),
                Sender       = new EndpointId("a"),
            };
            var msg = translator.ToMessage(data);

            Assert.IsInstanceOf(typeof(UnknownMessageTypeMessage), msg);
            Assert.AreSame(data.Id, msg.Id);
            Assert.AreSame(data.Sender, msg.Sender);
            Assert.AreSame(data.InResponseTo, msg.InResponseTo);
        }
        public void ToMessage()
        {
            var translator = new EndpointInteractionInformationResponseConverter();

            var data = new EndpointInteractionInformationResponseData
            {
                Id           = new MessageId(),
                InResponseTo = new MessageId(),
                Sender       = new EndpointId("a"),
                State        = InteractionConnectionState.Desired.ToString(),
            };
            var msg = translator.ToMessage(data);

            Assert.IsInstanceOf(typeof(EndpointInteractionInformationResponseMessage), msg);
            Assert.AreSame(data.Id, msg.Id);
            Assert.AreSame(data.Sender, msg.Sender);
            Assert.AreSame(data.InResponseTo, msg.InResponseTo);
            Assert.AreEqual(data.State, ((EndpointInteractionInformationResponseMessage)msg).State.ToString());
        }
        public void DataTypeToTranslate()
        {
            var translator = new EndpointInteractionInformationResponseConverter();

            Assert.AreEqual(typeof(EndpointInteractionInformationResponseData), translator.DataTypeToTranslate);
        }