Пример #1
0
        public void FilterSomeArticles()
        {
            List <Article> articles = new List <Article>(new[]
            {
                new Article("Test"), new Article("Commons:Test"),
                new Article("MediaWiki:Test"),
                new Article("MediaWiki talk: test"),
                new Article("User talk:Test")
            });

            List <Article> res = Tools.FilterSomeArticles(articles);

            Assert.AreEqual(2, res.Count);

            foreach (Article a in res)
            {
                Assert.IsFalse(a.Name.StartsWith("Commons:"));
                Assert.AreNotEqual(Namespace.MediaWiki, a.NameSpaceKey);
                Assert.AreNotEqual(Namespace.MediaWikiTalk, a.NameSpaceKey);
                Assert.IsTrue(a.NameSpaceKey >= Namespace.Article);
            }
        }