ConvertToWebSocketUri() private méthode

private ConvertToWebSocketUri ( string uriString ) : Uri
uriString string
Résultat System.Uri
Exemple #1
0
 public void ConvertToWebSocketUriAllowsOnlyHttpAndHttpsSchemes()
 {
     Assert.Equal(
         string.Format(CultureInfo.CurrentCulture, Resources.Error_InvalidUriScheme, "file"),
         Assert.Throws <InvalidOperationException>(
             () => UrlBuilder.ConvertToWebSocketUri("file:///C:/temp/out.txt")).Message);
 }
Exemple #2
0
            public void ConvertToWebSocketUriUsesUriBuilderToCheckInputParameters()
            {
                Assert.Equal("uriString",
                             Assert.Throws <ArgumentNullException>(
                                 () => UrlBuilder.ConvertToWebSocketUri(null)).ParamName);

                Assert.Throws <UriFormatException>(() => UrlBuilder.ConvertToWebSocketUri(string.Empty));
            }
Exemple #3
0
 public void ConvertToWebSocketUriConvertsToWebSocketUris()
 {
     Assert.Equal("ws://tempuri.org/", UrlBuilder.ConvertToWebSocketUri("http://tempuri.org").ToString());
     Assert.Equal("wss://tempuri.org/", UrlBuilder.ConvertToWebSocketUri("https://tempuri.org").ToString());
 }