Пример #1
0
		public void Can_serialize_IMessage_ToBytes_into_typed_Message()
		{
			var dto = new Incr { Value = 1 };
			var iMsg = Message.Create(dto);
			var bytes = iMsg.ToBytes();
			var typedMessage = bytes.ToMessage<Incr>();

			Assert.That(typedMessage.GetBody().Value, Is.EqualTo(dto.Value));
		}
Пример #2
0
		public void Can_serialize_object_IMessage_into_typed_Message()
		{
			var dto = new Incr { Value = 1 };
			var iMsg = Message.Create(dto);
			var json = ((object)iMsg).ToJson();
			var typedMessage = json.FromJson<Message<Incr>>();

			Assert.That(typedMessage.GetBody().Value, Is.EqualTo(dto.Value));
		}
Пример #3
0
        public void Can_serialize_IMessage_ToBytes_into_typed_Message()
        {
            var dto = new Incr {
                Value = 1
            };
            var iMsg         = MessageFactory.Create(dto);
            var bytes        = iMsg.ToBytes();
            var typedMessage = bytes.ToMessage <Incr>();

            Assert.That(typedMessage.GetBody().Value, Is.EqualTo(dto.Value));
        }
Пример #4
0
        public void Can_serialize_object_IMessage_into_typed_Message()
        {
            var dto = new Incr {
                Value = 1
            };
            var iMsg         = MessageFactory.Create(dto);
            var json         = ((object)iMsg).ToJson();
            var typedMessage = json.FromJson <Message <Incr> >();

            Assert.That(typedMessage.GetBody().Value, Is.EqualTo(dto.Value));
        }