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); }
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); }
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); }
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]); } } }