GetHashtags() public method

public GetHashtags ( string tweet ) : IEnumerable
tweet string
return IEnumerable
Esempio n. 1
0
        public void Given_Same_Hashtag_Is_Mentioned_Multiple_Times_Only_Single_Occurence_Returned()
        {
            var tweet = "test #hashtag and one more #hashtag";

            var tweetParser = new TweetParser();

            var hashtags = tweetParser.GetHashtags(tweet).ToList();

            Assert.That(hashtags.Count, Is.EqualTo(1));
        }
Esempio n. 2
0
        public void Given_Tweet_Contains_Hashtag_It_Is_Correctly_Parsed()
        {
            var tweet = "test #hashtag.";

            var tweetParser = new TweetParser();

            var hashtags = tweetParser.GetHashtags(tweet).ToList();

            Assert.That(hashtags.Count, Is.EqualTo(1));
            Assert.That(hashtags.Single(), Is.EqualTo("hashtag"));
        }