コード例 #1
0
        private string GetCookieRun()
        {
            var client = new FunnyQuoteserviceLegacy();
            var uri    = "http://FunnyQuotesLegacyService" + new Uri(client.Url).AbsolutePath;

            client.Url = _dicoveryAddressResolver.LookupService(new Uri(uri)).ToString();
            return(client.GetCookie());
        }
コード例 #2
0
        public void LookupService_FindsService_ReturnsURI()
        {
            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");

            var result = handler.LookupService(uri);

            Assert.Equal(new Uri("https://foundit:5555/test/bar/foo?test=1&test2=2"), result);
        }
コード例 #3
0
        public void LookupService_DoesntFindService_ReturnsOriginalURI()
        {
            IDiscoveryClient client = new TestDiscoveryClient();
            var handler             = new DiscoveryHttpClientHandlerBase(client);
            var uri = new Uri("https://foo/test");

            var result = handler.LookupService(uri);

            Assert.Equal(uri, result);
        }
コード例 #4
0
        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);
        }