当前位置: 首页>>代码示例>>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;未经允许,请勿转载。