예제 #1
0
        public void addTest()
        {
            trendingList list            = new trendingList();
            string       testVar         = "Test string";
            string       mixedStringTest = "123456ABCDEF_%^";

            list.add(mixedStringTest);
            list.add(testVar);
            Assert.AreEqual(trendingList.Trendings.ElementAt(0), mixedStringTest);
            Assert.AreEqual(trendingList.Trendings.ElementAt(1), testVar);
        }
예제 #2
0
        public void countTest()
        {
            trendingList list = new trendingList();

            trendingList.Trendings.Clear();
            string testVar         = "Test string";
            string mixedStringTest = "123456ABCDEF_%^";

            list.add(mixedStringTest);
            list.add(testVar);
            Assert.AreEqual(list.count(), 2);
        }
예제 #3
0
        public void returnValueTest()
        {
            trendingList list = new trendingList();

            trendingList.Trendings.Clear();
            string testVar         = "Test string with many characters in it";
            string mixedStringTest = "123456ABCDEF_%^";

            list.add(mixedStringTest);
            list.add(testVar);
            Assert.AreEqual(list.returnValue(0), mixedStringTest);
            Assert.AreEqual(list.returnValue(1), testVar);
        }
예제 #4
0
 public void detectHashtags(message asset, trendingList trending)
 {
     string[] bodyText = asset.Body.Split(null);
     for (int i = 0; i < bodyText.Length; i++)
     {
         if (bodyText[i].StartsWith("#"))
         {
             trending.add(bodyText[i]);
         }
     }
 }