public void Should_be_reversive()
        {
            var messageFormatter = new MessageFormatter(new Utf8MessageSerializer(null), new JsonMessageStringifier(null), null);

            var x = messageFormatter.Deformat(messageFormatter.Format(new MyTestMessage()
                                                                  {
                                                                      Set = "DDDDD"
                                                                  }));

            ((MyTestMessage) x).Set.Should().Be("DDDDD");
        }
        public void It_should_sent_messages_which_will_be_received()
        {
            var model1 = ComponentLocator.Current.Get<IModel>();
            var publisher = new MessagePublisher(model1,
                                                 new MessageFormatter(new Utf8MessageSerializer(null),
                                                                      new JsonMessageStringifier(null), null), new ResponseAwaiter(new MessageFormatter(new Utf8MessageSerializer(null), new JsonMessageStringifier(null), null ), null ),  null);
            publisher.Publish(new SampleMessage(){ Message = "Hello"}, "TestQueue1_1" );

            var model = ComponentLocator.Current.Get<IModel>();
            var subs = new RabbitMQ.Client.MessagePatterns.Subscription(model, "TestQueue1_1");
            var args = subs.Next();

            var messageFormatter = new MessageFormatter(new Utf8MessageSerializer(null), new JsonMessageStringifier(null), null);
            var obj = messageFormatter.Deformat(args.Body);

            obj.Should().NotBeNull();
            obj.Should().BeOfType<SampleMessage>();

            ((SampleMessage) obj).Message.Should().Be("Hello");

            subs.Close();
        }