public async Task LookupServiceAsync_FindsService_ReturnsURI()
        {
            // Arrange
            IDiscoveryClient client = new TestDiscoveryClient(new TestServiceInstance(new Uri("https://foundit:5555")));
            var handler             = new DiscoveryHttpClientHandlerBase(client);
            var uri = new Uri("https://foo/test/bar/foo?test=1&test2=2");

            // Act and Assert
            var result = await handler.LookupServiceAsync(uri);

            Assert.Equal(new Uri("https://foundit:5555/test/bar/foo?test=1&test2=2"), result);
        }
        public async Task LookupServiceAsync_DoesntFindService_ReturnsOriginalURI()
        {
            // Arrange
            IDiscoveryClient client = new TestDiscoveryClient();
            var handler             = new DiscoveryHttpClientHandlerBase(client);
            var uri = new Uri("https://foo/test");

            // Act and Assert
            var result = await handler.LookupServiceAsync(uri);

            Assert.Equal(uri, result);
        }
        public void LookupService_DoesntFindService_ReturnsOriginalURI()
        {
            // Arrange
            IDiscoveryClient client = new TestDiscoveryClient();
            DiscoveryHttpClientHandlerBase handler = new DiscoveryHttpClientHandlerBase(client);
            Uri uri = new Uri("https://foo/test");

            // Act and Assert
            var result = handler.LookupService(uri);

            Assert.Equal(uri, result);
        }
        public void LookupService_NonDefaultPort_ReturnsOriginalURI()
        {
            // Arrange
            IDiscoveryClient client = new TestDiscoveryClient();
            var handler             = new DiscoveryHttpClientHandlerBase(client);
            var uri = new Uri("https://foo:8080/test");

            // Act and Assert
            var result = handler.LookupService(uri);

            Assert.Equal(uri, result);
        }
        public void LookupService_FindsService_ReturnsURI()
        {
            // Arrange
            IDiscoveryClient client = new TestDiscoveryClient(new TestServiceInstance(new Uri("http://foundit:5555")));
            DiscoveryHttpClientHandlerBase handler = new DiscoveryHttpClientHandlerBase(client);
            Uri uri = new Uri("http://foo/test/bar/foo?test=1&test2=2");

            // Act and Assert
            var result = handler.LookupService(uri);

            Assert.Equal(new Uri("http://foundit:5555/test/bar/foo?test=1&test2=2"), result);
        }