Exemple #1
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));
		}
Exemple #2
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));
		}
        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));
        }
        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));
        }