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)); }
public void ParseFromUri_throws_if_uri_is_null(HttpEndpointAddress _) { Assert.Throws <ArgumentNullException>(() => HttpEndpointAddress.ParseFromUri(null)); }
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)); }