Ejemplo n.º 1
0
        public void ParseFromUri_returns_EndpointAddress(NamedPipeEndpointAddress testAddress)
        {
            var testUri = testAddress.ToUri();

            var address = NamedPipeEndpointAddress.ParseFromUri(testUri);

            Assert.That(address.Path, Is.EqualTo(testAddress.Path).IgnoreCase);
        }
Ejemplo n.º 2
0
        public void ParseFromUri_throws_if_invalid_host(NamedPipeEndpointAddress testAddress, string invalidHost)
        {
            var testUri = new UriBuilder(Uri.UriSchemeNetPipe, invalidHost, -1, testAddress.Path).Uri;

            Assert.Throws <ArgumentException>(() => NamedPipeEndpointAddress.ParseFromUri(testUri));
        }
Ejemplo n.º 3
0
 public void ParseFromUri_throws_if_uri_is_null(NamedPipeEndpointAddress _)
 {
     Assert.Throws <ArgumentNullException>(() => NamedPipeEndpointAddress.ParseFromUri(null));
 }
Ejemplo n.º 4
0
        public void ParseFromUri_throws_if_invalid_scheme(NamedPipeEndpointAddress testAddress, string invalidScheme)
        {
            var testUri = new UriBuilder(invalidScheme, "localhost", -1, testAddress.Path).Uri;

            Assert.Throws <ArgumentException>(() => NamedPipeEndpointAddress.ParseFromUri(testUri));
        }
Ejemplo n.º 5
0
        public void ParseFromUri_throws_if_invalid_port(NamedPipeEndpointAddress testAddress, int invalidPort)
        {
            var testUri = new UriBuilder(Uri.UriSchemeNetPipe, "localhost", invalidPort, testAddress.Path).Uri;

            Assert.Throws <ArgumentException>(() => NamedPipeEndpointAddress.ParseFromUri(testUri));
        }