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); }
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); }
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); }
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); }
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"]); }
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"]); }
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"]); }
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"]); }
public void SortByWeight_CaseInsensitive() { var weightedTags = new Mod.TagManager().SortByWeight(new string[] { "mytag", "MyTag", "MYTAG", "myTaG" }); Assert.AreEqual(1, weightedTags.Count); }
public void SortByWeight_CaseInsensitive() { var weightedTags = new Mod.TagManager().SortByWeight(new string[] { "mytag", "MyTag", "MYTAG", "myTaG" }); Assert.AreEqual(1, weightedTags.Count); }
public void SortByWeight_Empty() { var weightedTags = new Mod.TagManager().SortByWeight(new string[0]); Assert.AreEqual(0, weightedTags.Count); }
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"]); }
public void GetTagsByBlog_InvalidId() { var tags = new Mod.TagManager().GetTagsByBlog(ID.NewID); Assert.AreEqual(0, tags.Length); }
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); }
public void GetAllTags_Null() { var tags = new Mod.TagManager().GetAllTags(null); Assert.AreEqual(0, tags.Count); }
public void GetTagsByBlog_Null() { var tags = new Mod.TagManager().GetTagsByBlog((ID)null); Assert.AreEqual(0, tags.Length); }
public void GetTagsByBlog_InvalidId() { var tags = new Mod.TagManager().GetTagsByBlog(ID.NewID); Assert.AreEqual(0, tags.Length); }
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); }
public void GetAllTags_Null() { var tags = new Mod.TagManager().GetAllTags(null); Assert.AreEqual(0, tags.Count); }
public void SortByWeight_Empty() { var weightedTags = new Mod.TagManager().SortByWeight(new string[0]); Assert.AreEqual(0, weightedTags.Count); }
public void GetTagsByBlog_Null() { var tags = new Mod.TagManager().GetTagsByBlog((ID)null); Assert.AreEqual(0, tags.Length); }
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"]); }