예제 #1
0
 public void WithPrefixes()
 {
     Assert.AreEqual("Doe, John De", Tools.MakeHumanCatKey("John de Doe"));
 }
예제 #2
0
 public void WithApostrophes()
 {
     Assert.AreEqual("Ddoe, John", Tools.MakeHumanCatKey("J'ohn D'Doe"));
     Assert.AreEqual("Test", Tools.MakeHumanCatKey("'Test"));
 }
예제 #3
0
 public void WithJrSr()
 {
     Assert.AreEqual("Doe, John, Jr.", Tools.MakeHumanCatKey("John Doe, Jr."));
     Assert.AreEqual("Doe, John, Sr.", Tools.MakeHumanCatKey("John Doe, Sr."));
 }
예제 #4
0
 public void WithRomanNumbers()
 {
     Assert.AreEqual("Doe, John, Iii", Tools.MakeHumanCatKey("John Doe III"));
     Assert.AreEqual("Xvii", Tools.MakeHumanCatKey("XVII"));
 }
예제 #5
0
 public void WikiEncode()
 {
     Assert.AreEqual("foo", Tools.WikiEncode("foo"));
     Assert.AreEqual("Foo", Tools.WikiEncode("Foo"));
     Assert.AreEqual("foo_bar", Tools.WikiEncode("foo bar"));
     Assert.AreEqual("foo_bar", Tools.WikiEncode("foo_bar"));
     Assert.AreEqual("foo/bar", Tools.WikiEncode("foo/bar"));
     Assert.AreEqual("foo:bar", Tools.WikiEncode("foo:bar"));
     StringAssert.AreEqualIgnoringCase("Caf%C3%A9", Tools.WikiEncode("Café"));
     StringAssert.AreEqualIgnoringCase("%D1%82%D0%B5%D1%81%D1%82:%D1%82%D0%B5%D1%81%D1%82", Tools.WikiEncode("тест:тест"));
 }
예제 #6
0
 public void ServerName()
 {
     Assert.AreEqual("foo", Tools.ServerName("http://foo"));
     Assert.AreEqual("foo", Tools.ServerName("http://foo/"));
     Assert.AreEqual("foo.bar.com", Tools.ServerName("http://foo.bar.com/path/script?a=foo/bar"));
 }