Example #1
0
        public double CalculatePercentationOfTweetsThatContainEmojis()
        {
            var tweets                       = _tweetRepository.ReadAll().ToList();
            var tweetCount                   = tweets.Count();
            var tweetsWithEmojisCount        = tweets.Count(t => t.ContainsEmojis);
            var percentageOfTweetsWithEmojis = (double)tweetsWithEmojisCount / (double)tweetCount;

            return(Math.Round(percentageOfTweetsWithEmojis * 100, MidpointRounding.AwayFromZero));
        }