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

            var address = HttpEndpointAddress.ParseFromUri(testUri);

            Assert.That(address.Host, Is.EqualTo(testAddress.Host).IgnoreCase);
            Assert.That(address.Port, Is.EqualTo(testAddress.Port));
            Assert.That(address.Path, Is.EqualTo(testAddress.Path).IgnoreCase);
            Assert.That(address.IsSecure, Is.EqualTo(testAddress.IsSecure));
        }
Ejemplo n.º 2
0
 public void ParseFromUri_throws_if_uri_is_null(HttpEndpointAddress _)
 {
     Assert.Throws <ArgumentNullException>(() => HttpEndpointAddress.ParseFromUri(null));
 }
Ejemplo n.º 3
0
        public void ParseFromUri_throws_if_invalid_scheme(HttpEndpointAddress testAddress, string invalidScheme)
        {
            var testUri = new UriBuilder(invalidScheme, testAddress.Host, testAddress.Port, testAddress.Path).Uri;

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