Beispiel #1
0
        public void GetCollectionOfCharacterStatistics_PassListOfStrings_GetCorrectCharacterStatistics()
        {
            //Arrange
            CharacterStatistics characterStatistics = new CharacterStatistics();
            List <string>       headers             = GetListOfHeaders();
            IEnumerable <KeyValuePair <char, int> > expectedStatistics = GetExpectedStatistics();

            //Act
            IEnumerable <KeyValuePair <char, int> > results = characterStatistics.GetCollectionOfCharacterStatistics(headers);

            //Assert
            Assert.AreEqual(expectedStatistics, results);
        }
Beispiel #2
0
        public void Run()
        {
            //Get latest 20 headers
            List <string> headers = headerParser.GetLatestHeaders();

            //Get character statistics of headers
            IEnumerable <KeyValuePair <char, int> > characters = characterStatistics.GetCollectionOfCharacterStatistics(headers);

            //Save statistics to csv file
            csvProcessor.SaveStatisticsToCsv(characters);

            //Display statistics in console
            Console.WriteLine("------------------START: " + DateTime.Now + "--------------------");
            foreach (var c in characters)
            {
                Console.WriteLine(c.ToString());
            }
        }