public void EncodeFullUrl() { var result = UriHelper.Encode("http", new HostString("my.HoΨst:80"), new PathString("/un?escaped/base"), new PathString("/un?escaped"), new QueryString("?name=val%23ue"), new FragmentString("#my%20value")); Assert.Equal("http://my.xn--host-cpd:80/un%3Fescaped/base/un%3Fescaped?name=val%23ue#my%20value", result); }
public void EncodePartialUrl() { var result = UriHelper.Encode(new PathString("/un?escaped/base"), new PathString("/un?escaped"), new QueryString("?name=val%23ue"), new FragmentString("#my%20value")); Assert.Equal("/un%3Fescaped/base/un%3Fescaped?name=val%23ue#my%20value", result); }
public void EncodeEmptyFullUrl() { var result = UriHelper.Encode("http", new HostString(string.Empty)); Assert.Equal("http:///", result); }
public void EncodeEmptyPartialUrl() { var result = UriHelper.Encode(); Assert.Equal("/", result); }