Exemplo n.º 1
0
        public void TestSiteLink()
        {
            SiteLink siteLink = new SiteLink("enwiki", "Test");

            Assert.Equal("enwiki", siteLink.SiteId);
            Assert.Equal("Test", siteLink.PageName);
            Assert.Equal(0, siteLink.Badges.Count);
        }
Exemplo n.º 2
0
        public void TestRemoveBadge()
        {
            SiteLink siteLink = new SiteLink(
                "enwiki",
                "Test",
                new HashSet<ItemId> { new ItemId("Q12"), new ItemId("Q13") }
            );
            siteLink.Badges.Remove(new ItemId("Q13"));

            Assert.Equal(1, siteLink.Badges.Count);
            Assert.False(siteLink.Badges.Contains(new ItemId("Q13")));
        }
Exemplo n.º 3
0
        public void TestAddBadge()
        {
            SiteLink siteLink = new SiteLink(
                "enwiki",
                "Test",
                new HashSet<ItemId> { new ItemId("Q12"), new ItemId("Q13") }
            );
            siteLink.Badges.Add(new ItemId("Q14"));

            Assert.Equal(3, siteLink.Badges.Count);
            Assert.True(siteLink.Badges.Contains(new ItemId("Q14")));
        }