public void SearchAllTypes_ValidFormat_ReturnsFormattedString() { const string tweet = "@ghostmonk sometext @ghostmonk @ghostmonk moretext@ghostmonk #hash http://www.ghostmonk.com"; const string expectedResult = "<a href='http://www.twitter.com/ghostmonk' target='_blank'>@ghostmonk</a> sometext " + "<a href='http://www.twitter.com/ghostmonk' target='_blank'>@ghostmonk</a> <a href='http://www.twitter.com/ghostmonk' target='_blank'>@ghostmonk</a> " + "moretext@ghostmonk <a href='http://www.twitter.com/search?q=hash' target='_blank'>#hash</a> " + "<a href='http://www.ghostmonk.com' target='_blank'>http://www.ghostmonk.com</a>"; string actualResult = TweetParser.ParseTweet(tweet); Debug.Write(actualResult); Assert.AreEqual(expectedResult, actualResult); }
public Tweet Extract() => TweetParser.ParseTweet(Element.GetAttribute("content-desc"));