当前位置: 首页>>代码示例>>C#>>正文


C# ListMaker.NormalizeTitle方法代码示例

本文整理汇总了C#中WikiFunctions.Controls.Lists.ListMaker.NormalizeTitle方法的典型用法代码示例。如果您正苦于以下问题:C# ListMaker.NormalizeTitle方法的具体用法?C# ListMaker.NormalizeTitle怎么用?C# ListMaker.NormalizeTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WikiFunctions.Controls.Lists.ListMaker的用法示例。


在下文中一共展示了ListMaker.NormalizeTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NormalizeTitleSecure

 public void NormalizeTitleSecure()
 {
     ListMaker LMaker = new ListMaker();
     Assert.AreEqual("Foo", LMaker.NormalizeTitle(@"https://en.wikipedia.org/w/index.php?title=Foo&diff=3&oldid=4"));
 }
开发者ID:reedy,项目名称:AutoWikiBrowser,代码行数:5,代码来源:MiscellaneousTests.cs

示例2: NormalizeTitle

        public void NormalizeTitle()
        {
            ListMaker LMaker = new ListMaker();
            Assert.AreEqual("Foo", LMaker.NormalizeTitle(@"https://en.wikipedia.org/w/index.php?title=Foo&diff=3&oldid=4"));
            Assert.AreEqual("Foo", LMaker.NormalizeTitle(@"https://en.wikipedia.org/w/index.php?title=Foo&diff=3&curid=4"));
            Assert.AreEqual("Health effects of chocolate", LMaker.NormalizeTitle(@"https://en.wikipedia.org/w/index.php?title=Health_effects_of_chocolate&diff=4018&oldid=40182"));
            Assert.AreEqual("Foo", LMaker.NormalizeTitle(@"https://en.wikipedia.org/w/index.php?title=Foo&action=history"));
            Assert.AreEqual("Foo", LMaker.NormalizeTitle(@"https://en.wikipedia.org/w/index.php?title=Foo&action=edit"));
            Assert.AreEqual("Foo", LMaker.NormalizeTitle(@"https://en.wikipedia.org/w/index.php?title=Foo&oldid=5"));
            Assert.AreEqual("Science (journal)", LMaker.NormalizeTitle(@"https://en.wikipedia.org/w/index.php?title=Science%20%28journal%29&action=history"));
            Assert.AreEqual(@"Wikipedia:AutoWikiBrowser/Sandbox", LMaker.NormalizeTitle(@"https://en.wikipedia.org/w/index.php?title=Wikipedia:AutoWikiBrowser/Sandbox&action=edit"));
            Assert.AreEqual(@"Wikipedia:AutoWikiBrowser/Sandbox", LMaker.NormalizeTitle(@"en.wikipedia.org/w/index.php?title=Wikipedia:AutoWikiBrowser/Sandbox&action=edit"));
            Assert.AreEqual("Foo", LMaker.NormalizeTitle(@"https://en.wikipedia.org/w/index.php?title=Foo#References"));

            Assert.AreEqual("Foo", LMaker.NormalizeTitle(@"   Foo"), "cleans spacing from Firefox Category paste");

            Assert.AreEqual(@"Foo", LMaker.NormalizeTitle(@"https://en.wikipedia.org/w/index.php?title=Foo&pe=1&#Date_on"));
            Assert.AreEqual(@"Foo", LMaker.NormalizeTitle(@"Foo‎"), "title has left-to-right mark at the end");

            Assert.AreEqual("Foo", LMaker.NormalizeTitle(@"https://en.wikipedia.org/w/index.php?title=Foo&offset=20130214190000&action=history"), "cleans spacing from Firefox Category paste");
            Assert.AreEqual("Foo", LMaker.NormalizeTitle(@"https://en.wikipedia.org/w/?title=Foo"));
            Assert.AreEqual("Foo", LMaker.NormalizeTitle(@"https://en.wikipedia.org/wiki/Foo"));
            Assert.AreEqual("Foo", LMaker.NormalizeTitle(@"http://en.wikipedia.org/wiki/Foo"), "HTTP not HTTPS support");
            Assert.AreEqual("Foo", LMaker.NormalizeTitle(@"//en.wikipedia.org/w/index.php?title=Foo&action=history"), "Protocol-relative support");
            Assert.AreEqual("Foo", LMaker.NormalizeTitle(@"https://en.wikipedia.org/w/index.php?title=Foo&redirect=no"));

            Assert.AreEqual("Foo", LMaker.NormalizeTitle(@"https://en.wikipedia.org/w/index.php?title=Foo&type=revision&diff=75558108&oldid=65316243"));

            Assert.AreEqual("#[[Foo]]", LMaker.NormalizeTitle(@"#[[Foo]]"), "#wikilinked");
            Assert.AreEqual("Foo", LMaker.NormalizeTitle(@"Foo#bar"), "#wikilinked");
        }
开发者ID:reedy,项目名称:AutoWikiBrowser,代码行数:31,代码来源:MiscellaneousTests.cs


注:本文中的WikiFunctions.Controls.Lists.ListMaker.NormalizeTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。