本文整理汇总了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();
}
示例2: AssertShouldBeCachedReferenceTo
private static void AssertShouldBeCachedReferenceTo(Uri query, Uri expected)
{
query.Should().Be(expected);
TestData.HaveCachedResponseFor(query).Should().BeTrue();
}
示例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());
}
示例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");
}
}
示例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();
}
示例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");
}
示例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]");
}
示例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");
}