Ejemplo n.º 1
0
        public void CreateReportShouldReturnPopulatedReport()
        {
            var report = wordCounter.CreateReport();

            Assert.IsInstanceOf <Dictionary <int, int> >(report);
            Assert.That(report[1] == 1);
            Assert.That(report[2] == 1);
            Assert.That(report[3] == 0);
            Assert.That(report[4] == 2);
        }
Ejemplo n.º 2
0
        static void Main()
        {
            var bookBuilder   = new BookBuilder();
            var consoleWriter = new ConsoleWriter();

            var text   = TextReader.ReadText(path);
            var myBook = bookBuilder.PopulateBook(text);

            var wordCounter = new WordCounter(myBook);

            consoleWriter.WriteToConsole(wordCounter.CreateReport());
        }