示例#1
0
        public void ThrowExceptionIfServiceOrPathDoesntExist(string serviceName, string pathName)
        {
            var provider = new ServiceDiscoveryProvider(GetConfiguration(), ServiceDiscoveryOptions.Default);

            Action action = () => provider.GetPath(serviceName, pathName);

            action.Should().Throw <ArgumentException>();
        }
示例#2
0
        public void FindPathUriByServiceTypeAndPathName(TestServiceType serviceType, string pathName, string expectedUri)
        {
            var provider = new ServiceDiscoveryProvider(GetConfiguration(), ServiceDiscoveryOptions.Default);

            Uri uri = provider.GetPath(serviceType, pathName);

            uri.ToString().Should().Be(expectedUri);
        }
示例#3
0
        public void FindPathUriByServiceAndPathName(string serviceName, string pathName, string expectedUri, bool allowHost)
        {
            var provider = new ServiceDiscoveryProvider(GetConfiguration(), new ServiceDiscoveryOptions()
            {
                AllowServiceNameAsHost = allowHost
            });

            Uri uri = provider.GetPath(serviceName, pathName);

            uri.ToString().Should().Be(expectedUri);
        }