示例#1
0
 public void TestNormal()
 {
     var ub = new UrlBuilder("http://llf.hanzify.org/llf/search.asp");
     ub.Add("Where", "title");
     ub.Add("keyword", "DbEntry");
     string dst = ub.ToString();
     Assert.AreEqual("http://llf.hanzify.org/llf/search.asp?Where=title&keyword=DbEntry", dst);
 }
示例#2
0
 public void TestUnicodeAsDefault()
 {
     var ub = new UrlBuilder("http://llf.hanzify.org/llf/search.asp", Encoding.Unicode);
     ub.Add("Where", "title");
     ub.Add("keyword", "vb");
     string dst = ub.ToString();
     Assert.AreEqual("http://llf.hanzify.org/llf/search.asp?Where=t%00i%00t%00l%00e%00&keyword=v%00b%00", dst);
 }
示例#3
0
 public void TestChineseGbk()
 {
     var ub = new UrlBuilder("http://llf.hanzify.org/llf/search.asp");
     ub.Add("Where", "title");
     ub.Add("keyword", "中文", Util.GetGbkEncoding());
     string dst = ub.ToString();
     Assert.AreEqual("http://llf.hanzify.org/llf/search.asp?Where=title&keyword=%d6%d0%ce%c4", dst);
 }