Example #1
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"]);
        }
Example #2
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"]);
        }
Example #3
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"]);
 }
Example #4
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"]);
 }