Inheritance: ITagManager
Exemple #1
0
        public void GetAllTags_EntryItem()
        {
            var tags = new Mod.TagManager().GetAllTags(new Items.WeBlog.BlogHomeItem(m_entry1));

            //entry is part of blog w/ 3 tags
            Assert.AreEqual(3, tags.Count);
        }
Exemple #2
0
 public void GetTagsByBlog_Blog1()
 {
     var tags = new Mod.TagManager().GetTagsByBlog(m_blog1.ID);
     Assert.Contains("taga", tags);
     Assert.Contains("tagb", tags);
     Assert.Contains("tagc", tags);
 }
Exemple #3
0
        public void GetTagsByBlog_EntryID()
        {
            var tags = new Mod.TagManager().GetTagsByBlog(m_entry1.ID);

            //entry is part of blog w/ 3 tags
            Assert.AreEqual(3, tags.Length);
        }
Exemple #4
0
        public void GetTagsByBlog_Blog1()
        {
            var tags = new Mod.TagManager().GetTagsByBlog(m_blog1.ID);

            Assert.Contains("taga", tags);
            Assert.Contains("tagb", tags);
            Assert.Contains("tagc", tags);
        }
Exemple #5
0
 public void GetAllTags_Blog1()
 {
     var tags = new Mod.TagManager().GetAllTags(new Items.WeBlog.BlogHomeItem(m_blog1));
     Assert.IsTrue(tags.ContainsKey("taga"), "taga not found");
     Assert.IsTrue(tags.ContainsKey("tagb"), "tagb not found");
     Assert.IsTrue(tags.ContainsKey("tagc"), "tagc not found");
     Assert.AreEqual(1, tags["tagb"]);
     Assert.AreEqual(2, tags["tagc"]);
     Assert.AreEqual(3, tags["taga"]);
 }
Exemple #6
0
        public void GetAllTags_Blog1()
        {
            var tags = new Mod.TagManager().GetAllTags(new Items.WeBlog.BlogHomeItem(m_blog1));

            Assert.IsTrue(tags.ContainsKey("taga"), "taga not found");
            Assert.IsTrue(tags.ContainsKey("tagb"), "tagb not found");
            Assert.IsTrue(tags.ContainsKey("tagc"), "tagc not found");
            Assert.AreEqual(1, tags["tagb"]);
            Assert.AreEqual(2, tags["tagc"]);
            Assert.AreEqual(3, tags["taga"]);
        }
Exemple #7
0
        public void SortByWeight_Normal()
        {
            var weightedTags = new Mod.TagManager().SortByWeight(new string[] { "a", "a", "b", "c", "c", "c", "c", "a", "b" });

            Assert.AreEqual(3, weightedTags.Count);
            Assert.AreEqual("a", weightedTags.ElementAt(0).Key);
            Assert.AreEqual(3, weightedTags["a"]);
            Assert.AreEqual("b", weightedTags.ElementAt(1).Key);
            Assert.AreEqual(2, weightedTags["b"]);
            Assert.AreEqual("c", weightedTags.ElementAt(2).Key);
            Assert.AreEqual(4, weightedTags["c"]);
        }
Exemple #8
0
        public void SortByWeight_SameWeight()
        {
            var weightedTags = new Mod.TagManager().SortByWeight(new string[] { "a", "b", "c", "A", "B", "C", "D", "d" });

            Assert.AreEqual(4, weightedTags.Count);
            Assert.AreEqual("a", weightedTags.ElementAt(0).Key);
            Assert.AreEqual(2, weightedTags["a"]);
            Assert.AreEqual("b", weightedTags.ElementAt(1).Key);
            Assert.AreEqual(2, weightedTags["b"]);
            Assert.AreEqual("c", weightedTags.ElementAt(2).Key);
            Assert.AreEqual(2, weightedTags["c"]);
            Assert.AreEqual("D", weightedTags.ElementAt(3).Key);
            Assert.AreEqual(2, weightedTags["d"]);
        }
Exemple #9
0
 public void SortByWeight_CaseInsensitive()
 {
     var weightedTags = new Mod.TagManager().SortByWeight(new string[] { "mytag", "MyTag", "MYTAG", "myTaG" });
     Assert.AreEqual(1, weightedTags.Count);
 }
Exemple #10
0
        public void SortByWeight_CaseInsensitive()
        {
            var weightedTags = new Mod.TagManager().SortByWeight(new string[] { "mytag", "MyTag", "MYTAG", "myTaG" });

            Assert.AreEqual(1, weightedTags.Count);
        }
Exemple #11
0
        public void SortByWeight_Empty()
        {
            var weightedTags = new Mod.TagManager().SortByWeight(new string[0]);

            Assert.AreEqual(0, weightedTags.Count);
        }
Exemple #12
0
 public void SortByWeight_SameWeight()
 {
     var weightedTags = new Mod.TagManager().SortByWeight(new string[] { "a", "b", "c", "A", "B", "C", "D", "d" });
     Assert.AreEqual(4, weightedTags.Count);
     Assert.AreEqual("a", weightedTags.ElementAt(0).Key);
     Assert.AreEqual(2, weightedTags["a"]);
     Assert.AreEqual("b", weightedTags.ElementAt(1).Key);
     Assert.AreEqual(2, weightedTags["b"]);
     Assert.AreEqual("c", weightedTags.ElementAt(2).Key);
     Assert.AreEqual(2, weightedTags["c"]);
     Assert.AreEqual("D", weightedTags.ElementAt(3).Key);
     Assert.AreEqual(2, weightedTags["d"]);
 }
Exemple #13
0
        public void GetTagsByBlog_InvalidId()
        {
            var tags = new Mod.TagManager().GetTagsByBlog(ID.NewID);

            Assert.AreEqual(0, tags.Length);
        }
Exemple #14
0
 public void GetAllTags_EntryItem()
 {
     var tags = new Mod.TagManager().GetAllTags(new Items.WeBlog.BlogHomeItem(m_entry1));
     //entry is part of blog w/ 3 tags
     Assert.AreEqual(3, tags.Count);
 }
Exemple #15
0
 public void GetAllTags_Null()
 {
     var tags = new Mod.TagManager().GetAllTags(null);
     Assert.AreEqual(0, tags.Count);
 }
Exemple #16
0
 public void GetTagsByBlog_Null()
 {
     var tags = new Mod.TagManager().GetTagsByBlog((ID)null);
     Assert.AreEqual(0, tags.Length);
 }
Exemple #17
0
 public void GetTagsByBlog_InvalidId()
 {
     var tags = new Mod.TagManager().GetTagsByBlog(ID.NewID);
     Assert.AreEqual(0, tags.Length);
 }
Exemple #18
0
 public void GetTagsByBlog_EntryID()
 {
     var tags = new Mod.TagManager().GetTagsByBlog(m_entry1.ID);
     //entry is part of blog w/ 3 tags
     Assert.AreEqual(3, tags.Length);
 }
Exemple #19
0
        public void GetAllTags_Null()
        {
            var tags = new Mod.TagManager().GetAllTags(null);

            Assert.AreEqual(0, tags.Count);
        }
Exemple #20
0
 public void SortByWeight_Empty()
 {
     var weightedTags = new Mod.TagManager().SortByWeight(new string[0]);
     Assert.AreEqual(0, weightedTags.Count);
 }
Exemple #21
0
        public void GetTagsByBlog_Null()
        {
            var tags = new Mod.TagManager().GetTagsByBlog((ID)null);

            Assert.AreEqual(0, tags.Length);
        }
Exemple #22
0
 public void SortByWeight_Normal()
 {
     var weightedTags = new Mod.TagManager().SortByWeight(new string[] { "a", "a", "b", "c", "c", "c", "c", "a", "b" });
     Assert.AreEqual(3, weightedTags.Count);
     Assert.AreEqual("a", weightedTags.ElementAt(0).Key);
     Assert.AreEqual(3, weightedTags["a"]);
     Assert.AreEqual("b", weightedTags.ElementAt(1).Key);
     Assert.AreEqual(2, weightedTags["b"]);
     Assert.AreEqual("c", weightedTags.ElementAt(2).Key);
     Assert.AreEqual(4, weightedTags["c"]);
 }