Esempio n. 1
0
        public void GetNamedPipeEndpointAddress_can_return_endpoint(ConfigurationBuilder builder, NamedPipeEndpointAddress testAddress)
        {
            var configuration = builder.AddInMemoryCollection(new Dictionary <string, string>()
            {
                ["Path"] = testAddress.Path
            }).Build();

            Uri result = ConfigurationExtensions.GetNamedPipeEndpointAddress(configuration);

            Assert.That(result.Scheme, Is.EqualTo(Uri.UriSchemeNetPipe));
            Assert.That(result.Host, Is.EqualTo("localhost"));
            Assert.That(result.IsDefaultPort, Is.True);
            Assert.That(result.AbsolutePath, Is.EqualTo("/" + testAddress.Path).IgnoreCase);
        }
Esempio n. 2
0
        public void GetBasicHttpEndpointAddress_can_return_endpoint(ConfigurationBuilder builder, HttpEndpointAddress testAddress)
        {
            var configuration = builder.AddInMemoryCollection(new Dictionary <string, string>()
            {
                ["Host"] = testAddress.Host,
                ["Port"] = testAddress.Port.ToString(),
                ["Path"] = testAddress.Path
            }).Build();

            Uri result = ConfigurationExtensions.GetBasicHttpEndpointAddress(configuration);

            Assert.That(result.Scheme, Is.EqualTo(Uri.UriSchemeHttp));
            Assert.That(result.Host, Is.EqualTo(testAddress.Host).IgnoreCase);
            Assert.That(result.Port, Is.EqualTo(testAddress.Port));
            Assert.That(result.AbsolutePath, Is.EqualTo("/" + testAddress.Path).IgnoreCase);
        }