Inheritance: ITweetParser
示例#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));
        }
示例#2
0
        public void Given_Tweet_Contains_Url_It_Is_Correctly_Parsed()
        {
            var tweet = "test http://localhost url";

            var tweetParser = new TweetParser();

            var urls = tweetParser.GetUrls(tweet).ToList();

            Assert.That(urls.Count, Is.EqualTo(1));
            Assert.That(urls.Single(), Is.EqualTo("http://localhost"));
        }
示例#3
0
        public void Given_Tweet_Contains_Mention_It_Is_Correctly_Parsed()
        {
            var tweet = "test @mention!";

            var tweetParser = new TweetParser();

            var mentions = tweetParser.GetMentions(tweet).ToList();

            Assert.That(mentions.Count, Is.EqualTo(1));
            Assert.That(mentions.Single(), Is.EqualTo("mention"));
        }
示例#4
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"));
        }