public void TestMethod()
        {
            var queueName = @".\private$\MyTestQueue";

            if (!MessageQueue.Exists(queueName))
            {
                MessageQueue.Create(queueName, true); // transactional!!!
            }

            var queue = new MessageQueue(queueName);

            var msg = new SimpleMessage3() { Id = Guid.NewGuid(), Text = "Muaha!" };

            SendMessage(msg, queue);

            var message = ReceiveMessage(queue);

        }
        public void SimpleTest()
        {
            var unity = new UnityContainer();
            var tracker = new Tracker();
            unity.RegisterInstance(tracker);

            var config = new Configuration(unity)
                .SetInputQueue("PSB.App1.Input1")
                .SetErrorQueue("PSB.App1.Error")
                .AddEndpoint("Paralect.ServiceBus.Test.Messages", "PSB.App2.Input1");

            var bus = new ServiceBus(config);
            bus.Run();

            var config2 = new Configuration(unity)
                .SetInputQueue("PSB.App2.Input1")
                .SetErrorQueue("PSB.App2.Error")
                .AddEndpoint("Paralect.ServiceBus.Test.Messages", "PSB.App1.Input1")
                .AddHandlers(Assembly.GetExecutingAssembly())
                .AddInterceptor(typeof(FirstInterceptor))
                .AddInterceptor(typeof(SecondInterceptor));

            var bus2 = new ServiceBus(config2);
            bus2.Run();

            var msg = new SimpleMessage3
            {
                Id = Guid.NewGuid(),
                Text = "From dddbfdfdgfgusd! Muaha!"
            };

            bus.Send(msg);

            Thread.Sleep(3000);

            Assert.AreEqual(1, tracker.Handlers.Count);
            Assert.AreEqual(2, tracker.Interceptors.Count);
            Assert.AreEqual(typeof(SimpleMessage3), tracker.Handlers[0]);
            Assert.AreEqual(typeof(FirstInterceptor), tracker.Interceptors[0]);
            Assert.AreEqual(typeof(SecondInterceptor), tracker.Interceptors[1]);
        }