public void WhenSubscribingItChecksPrefixOfMessageFilter(string filter, string destination, Type message)
        {
            MessageSinkStub sink = new MessageSinkStub();

            RouteManager.AddRoute(filter, destination);

            // Act
            Service.Subscribe(message, sink);

            // Assert
            Assert.AreEqual(destination, sink.LastDestination.Name);
            Assert.IsInstanceOf <SubscribeCommand>(sink.LastMessage.Body);
            SubscribeCommand sc = (SubscribeCommand)sink.LastMessage.Body;

            Assert.AreEqual(message.AssemblyQualifiedName, sc.SubscribedMessagesTypeName);
        }
        public void WhenSubscribingItFollowsMatchingRoutes()
        {
            // Arrange
            MessageSinkStub sink = new MessageSinkStub();

            RouteManager.AddRoute("Xyperico.Agres.Tests.MessageBus", "Trilian");
            RouteManager.AddRoute("Rofl.abc", "Max");

            // Act
            Service.Subscribe(typeof(MessageToSubscribe1), sink);

            // Assert
            Assert.AreEqual("Trilian", sink.LastDestination.Name);
            Assert.IsInstanceOf <SubscribeCommand>(sink.LastMessage.Body);
            SubscribeCommand sc = (SubscribeCommand)sink.LastMessage.Body;

            Assert.AreEqual(MyQueueName.Name, sc.SubscriberQueueName);
            Assert.AreEqual(typeof(MessageToSubscribe1).AssemblyQualifiedName, sc.SubscribedMessagesTypeName);
        }
        public void WhenSubscribingItFollowsMatchingRoutes()
        {
            // Arrange
              MessageSinkStub sink = new MessageSinkStub();
              RouteManager.AddRoute("Xyperico.Agres.Tests.MessageBus", "Trilian");
              RouteManager.AddRoute("Rofl.abc", "Max");

              // Act
              Service.Subscribe(typeof(MessageToSubscribe1), sink);

              // Assert
              Assert.AreEqual("Trilian", sink.LastDestination.Name);
              Assert.IsInstanceOf<SubscribeCommand>(sink.LastMessage.Body);
              SubscribeCommand sc = (SubscribeCommand)sink.LastMessage.Body;
              Assert.AreEqual(MyQueueName.Name, sc.SubscriberQueueName);
              Assert.AreEqual(typeof(MessageToSubscribe1).AssemblyQualifiedName, sc.SubscribedMessagesTypeName);
        }
        public void WhenSubscribingItChecksPrefixOfMessageFilter(string filter, string destination, Type message)
        {
            MessageSinkStub sink = new MessageSinkStub();
              RouteManager.AddRoute(filter, destination);

              // Act
              Service.Subscribe(message, sink);

              // Assert
              Assert.AreEqual(destination, sink.LastDestination.Name);
              Assert.IsInstanceOf<SubscribeCommand>(sink.LastMessage.Body);
              SubscribeCommand sc = (SubscribeCommand)sink.LastMessage.Body;
              Assert.AreEqual(message.AssemblyQualifiedName, sc.SubscribedMessagesTypeName);
        }