public void Returns_two_different_stored_logical_endpoints() { var instanceA = new EndpointInstanceId("EndpointA", "instance1"); var instanceB = new EndpointInstanceId("EndpointB", "instance2"); registry.Record(instanceA); registry.Record(instanceB); var endpoints = registry.GetGroupedByEndpointName(); CollectionAssert.AreEquivalent(new[] { "EndpointA", "EndpointB" }, endpoints.Keys); }
static MonitoredEndpoint[] GetMonitoredEndpoints(EndpointRegistry endpointRegistry, EndpointInstanceActivityTracker activityTracker) { return(endpointRegistry.GetGroupedByEndpointName() .Select(endpoint => new MonitoredEndpoint { Name = endpoint.Key, EndpointInstanceIds = endpoint.Value.Select(i => i.InstanceId).ToArray(), IsStale = endpoint.Value.Any(activityTracker.IsStale) }) .ToArray()); }