Esempio n. 1
0
        public void AlertProperties()
        {
            Article a = new Article("A", "{{dead link}}");
            Assert.AreEqual(1, a.DeadLinks().Count);
            Assert.IsTrue(a.HasDeadLinks);

            a = new Article("A", "<small>");
            Assert.AreEqual(1, a.UnclosedTags().Count);

            a = new Article("A", "==[[A]]==");
            Assert.AreEqual(1, a.WikiLinkedHeaders().Count);

            a = new Article("A", "{{multiple issues|foo=bar}}");
            Assert.AreEqual(1, a.UnknownMultipleIssuesParameters().Count);

            a = new Article("Talk:A", "{{WikiProjectBannerShell|foo=bar}}");
            Assert.AreEqual(1, a.UnknownWikiProjectBannerShellParameters().Count);

            a = new Article("Talk:A", "{{WikiProjectBannerShell|foo=bar|foo=bar}}");
            Assert.AreEqual(1, a.DuplicateWikiProjectBannerShellParameters().Count);

            a = new Article("A", "[[A|B|C]]");
            Assert.AreEqual(1, a.DoublepipeLinks().Count);

            a = new Article("A", "[[A||BC]]");
            Assert.AreEqual(1, a.DoublepipeLinks().Count);

            a = new Article("A", "[[|A]]");
            Assert.AreEqual(1, a.TargetlessLinks().Count);

            a = new Article("A", "{{cite web|sajksdfa=a}}");
            Assert.AreEqual(1, a.BadCiteParameters().Count);

            a = new Article("A", "{{cite web|date=5-4-10}}");
            Assert.AreEqual(1, a.AmbiguousCiteTemplateDates().Count);

            a = new Article("A", "[[User talk:Noobie]]");
            Assert.AreEqual(1, a.UserSignature().Count);

            a.ResetEditSummary();
            Assert.AreEqual("", a.EditSummary);
        }