public void WithPrefixes() { Assert.AreEqual("Doe, John De", Tools.MakeHumanCatKey("John de Doe")); }
public void WithApostrophes() { Assert.AreEqual("Ddoe, John", Tools.MakeHumanCatKey("J'ohn D'Doe")); Assert.AreEqual("Test", Tools.MakeHumanCatKey("'Test")); }
public void WithJrSr() { Assert.AreEqual("Doe, John, Jr.", Tools.MakeHumanCatKey("John Doe, Jr.")); Assert.AreEqual("Doe, John, Sr.", Tools.MakeHumanCatKey("John Doe, Sr.")); }
public void WithRomanNumbers() { Assert.AreEqual("Doe, John, Iii", Tools.MakeHumanCatKey("John Doe III")); Assert.AreEqual("Xvii", Tools.MakeHumanCatKey("XVII")); }
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("тест:тест")); }
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")); }