public void Add_ShouldGiveCharCountsOfCharacters()
 {
     var totaliser = new CharacterTotaliser();
     totaliser.Add("abca.");
     totaliser.Add("foo bar wibble!");
     var counts = totaliser.GetCharCounts();
     Assert.That(counts['a'], Is.EqualTo(3));
     Assert.That(counts['b'], Is.EqualTo(4));
 }
        private ICharacterCounter ComputeCharCounts(ITextFile textFile)
        {
            ++NumberOfCallsToComputeCharCounts;
            var counter = new CharacterTotaliser();
            foreach (string line in textFile.ReadLines())
            {
                counter.Add(line);
            }

            return counter;
        }
        private IReadOnlyDictionary<char, int> ComputeCharCounts(IReadOnlyCollection<string> allLines)
        {
            using (SystemMode.Counter) // don't remove this - that's cheating!
            {
                var totaliser = new CharacterTotaliser();
                foreach (string line in allLines)
                {
                    totaliser.Add(line);
                }

                return totaliser.GetCharCounts();
            }
        }