public void Should_be_able_to_create_a_new_route() { var map = new MessageRoute(new Uri("route://")); map.AddSpecification(new RegexMessageRouteSpecification("simple")); Assert.IsFalse(map.IsSatisfiedBy(new OtherNamespaceCommand().GetType().FullName)); Assert.IsTrue(map.IsSatisfiedBy(new SimpleCommand().GetType().FullName)); }
public void Should_be_able_to_create_a_new_route() { IMessageRoute map = new MessageRoute(new MemoryQueue(new Uri("memory://."))); map.AddSpecification(new RegexMessageRouteSpecification("simple")); Assert.IsFalse(map.IsSatisfiedBy(new OtherNamespaceCommand())); Assert.IsTrue(map.IsSatisfiedBy(new SimpleCommand())); }
public void Should_be_able_to_create_new_routes() { var route = new MessageRoute(new Uri("route://")); var routes = new MessageRouteCollection(); route.AddSpecification(new RegexMessageRouteSpecification("simple")); routes.Add(route); Assert.AreSame(route.Uri, routes.FindAll(new SimpleCommand().GetType().FullName)[0].Uri); }
public void Should_be_able_to_create_new_routes() { var queue = new MemoryQueue(new Uri("memory://.")); var route = new MessageRoute(queue); var routes = new MessageRouteCollection(); route.AddSpecification(new RegexMessageRouteSpecification("simple")); routes.Add(route); Assert.AreSame(queue, routes.FindAll(new SimpleCommand())[0].Queue); }
public void Should_be_able_to_create_new_routes() { var queue = new Mock <IQueue>(); var route = new MessageRoute(queue.Object); var routes = new MessageRouteCollection(); queue.Setup(m => m.Uri).Returns(new Uri("uri://somewhere")); route.AddSpecification(new RegexMessageRouteSpecification("simple")); routes.Add(route); Assert.AreSame(queue.Object, routes.FindAll(new SimpleCommand().GetType().FullName)[0].Queue); }
public void Should_be_able_to_create_new_routes() { var queue = new Mock<IQueue>(); var route = new MessageRoute(queue.Object); var routes = new MessageRouteCollection(); queue.Setup(m => m.Uri).Returns(new Uri("uri://somewhere")); route.AddSpecification(new RegexMessageRouteSpecification("simple")); routes.Add(route); Assert.AreSame(queue.Object, routes.FindAll(new SimpleCommand().GetType().FullName)[0].Queue); }