當前位置: 首頁>>代碼示例>>C#>>正文


C# Uri.Should方法代碼示例

本文整理匯總了C#中System.Uri.Should方法的典型用法代碼示例。如果您正苦於以下問題:C# Uri.Should方法的具體用法?C# Uri.Should怎麽用?C# Uri.Should使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Uri的用法示例。


在下文中一共展示了Uri.Should方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Getting_user_info_parts_When_nothing_is_provided_It_returns_empty_array

        public void Getting_user_info_parts_When_nothing_is_provided_It_returns_empty_array()
        {
            var r = new Uri("http://localhost:5984").GetUserInfoParts();

            r.Should().NotBeNull();
            r.Should().BeEmpty();
        }
開發者ID:sluu99,項目名稱:mycouch,代碼行數:7,代碼來源:UriExtensionsTests.cs

示例2: AssertShouldBeCachedReferenceTo

 private static void AssertShouldBeCachedReferenceTo(Uri query, Uri expected)
 {
     query.Should().Be(expected);
     TestData.HaveCachedResponseFor(query).Should().BeTrue();
 }
開發者ID:OData,項目名稱:OData4Soda,代碼行數:5,代碼來源:LoadFullCachedResponses.cs

示例3: should_have_correct_target_uri

 public void should_have_correct_target_uri()
 {
     CloudActive.Target(TestAccountInformation.GoodUri.ToString());
     var designatedUri = new Uri(CloudActive.CurrentUri);
     designatedUri.Should().Be(TestAccountInformation.GoodUri.ToString());
 }
開發者ID:BrianMMcClain,項目名稱:vcap-client,代碼行數:6,代碼來源:when_using_vcap_client.cs

示例4: ShouldRedirectToFailurePathIfErrorIn

        public void ShouldRedirectToFailurePathIfErrorIn()
        {
            // See https://tools.ietf.org/html/rfc6749#section-4.1.2.1
            using (TestAppHost())
            {
                Subject.ClientId = "c1";
                Subject.FailureRedirectPath = "/auth-failure";
                var request = new MockHttpRequest("auth", "GET", "text", "/auth/foo?error=invalid_request", new NameValueCollection {{"error", "invalid_request"}}, Stream.Null, null);
                var mockAuthService = MockAuthService(request);

                var response = Subject.Authenticate(mockAuthService.Object, new AuthUserSession(), new Authenticate());

                var result = (IHttpResult)response;
                var redirectRequest = new Uri(result.Headers["Location"]);
                redirectRequest.Should().Be("http://localhost/auth-failure");
                //var query = PclExportClient.Instance.ParseQueryString(redirectRequest.Query);
                //query["response_type"].Should().Be("code");
            }
        }
開發者ID:jfoshee,項目名稱:ServiceStack.Authentication.Aad,代碼行數:19,代碼來源:AadAuthProviderTest.cs

示例5: Getting_basic_auth_string_When_nothing_is_provided_It_returns_null

        public void Getting_basic_auth_string_When_nothing_is_provided_It_returns_null()
        {
            var r = new Uri("http://localhost:5984").GetBasicAuthString();

            r.Should().BeNull();
        }
開發者ID:sluu99,項目名稱:mycouch,代碼行數:6,代碼來源:UriExtensionsTests.cs

示例6: Getting_user_info_parts_When_non_encoded_user_and_password_are_provided_It_extracts_user_and_password

        public void Getting_user_info_parts_When_non_encoded_user_and_password_are_provided_It_extracts_user_and_password()
        {
            var r = new Uri("http://tstUser:[email protected]:5984").GetUserInfoParts();

            r.Should().BeEquivalentTo("tstUser", "tstPwd");
        }
開發者ID:sluu99,項目名稱:mycouch,代碼行數:6,代碼來源:UriExtensionsTests.cs

示例7: Uri

        public void Getting_user_info_parts_When_encoded_user_and_password_are_provided_It_extracts_decoded_user_and_password()
        {
            var r = new Uri("http://s%40:p%[email protected]:5984").GetUserInfoParts();

            r.Should().BeEquivalentTo("[email protected]", "[email protected]");
        }
開發者ID:sluu99,項目名稱:mycouch,代碼行數:6,代碼來源:UriExtensionsTests.cs

示例8: Getting_absolute_uri_excluding_user_info_When_no_user_info_exists_It_should_return_uri

        public void Getting_absolute_uri_excluding_user_info_When_no_user_info_exists_It_should_return_uri()
        {
            var r = new Uri("http://localhost:5984/resource/1").GetAbsoluteUriExceptUserInfo();

            r.Should().Be("http://localhost:5984/resource/1");
        }
開發者ID:sluu99,項目名稱:mycouch,代碼行數:6,代碼來源:UriExtensionsTests.cs


注:本文中的System.Uri.Should方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。