public void Should_default_to_single_instance_when_not_configured() { var instances = new EndpointInstances(); var salesInstancess = instances.FindInstances("Sales"); var singleInstance = salesInstancess.Single(); Assert.IsNull(singleInstance.Discriminator); Assert.IsEmpty(singleInstance.Properties); }
public void Setup() { routingTable = new UnicastRoutingTable(); endpointInstances = new EndpointInstances(); router = new UnicastSendRouter( routingTable, endpointInstances, i => i.ToString()); }
public void Should_filter_out_duplicate_instances() { var instances = new EndpointInstances(); var sales = "Sales"; instances.AddOrReplaceInstances("A", new List<EndpointInstance> { new EndpointInstance(sales, "dup"), new EndpointInstance(sales, "dup") }); var salesInstances = instances.FindInstances(sales); Assert.AreEqual(1, salesInstances.Count()); }
public void Should_return_instances_configured_by_static_route() { var instances = new EndpointInstances(); var sales = "Sales"; instances.AddOrReplaceInstances("A", new List<EndpointInstance> { new EndpointInstance(sales, "1"), new EndpointInstance(sales, "2") }); var salesInstances = instances.FindInstances(sales); Assert.AreEqual(2, salesInstances.Count()); }
public void Should_add_instances_grouped_by_endpoint_name() { var instances = new EndpointInstances(); const string endpointName1 = "EndpointA"; const string endpointName2 = "EndpointB"; instances.AddOrReplaceInstances("A", new List<EndpointInstance> { new EndpointInstance(endpointName1), new EndpointInstance(endpointName2) }); var salesInstances = instances.FindInstances(endpointName1); Assert.AreEqual(1, salesInstances.Count()); var otherInstances = instances.FindInstances(endpointName2); Assert.AreEqual(1, otherInstances.Count()); }
public void Setup() { metadataRegistry = new MessageMetadataRegistry(new Conventions()); endpointInstances = new EndpointInstances(); subscriptionStorage = new FakeSubscriptionStorage(); router = new UnicastPublishRouter( metadataRegistry, subscriptionStorage); }