Beispiel #1
0
        public void GetStatistics_WithNonSpaceDelimiter_ReturnIncorrectCounting(string textQuery, int expectingWords)
        {
            //Arrange
            ICountingStatisticCalculator wordCalculator = new WordCalculator();

            //Action
            ITextCountingStatistic result = wordCalculator.GetStatistics(textQuery);

            //Assert
            Assert.False(result.GetCount() == expectingWords);
        }
Beispiel #2
0
        public void WordCalculatorTest()
        {
            //Arrange
            var input          = "hi you how you";
            var expectedOutput = "hi, 1"
                                 + "\r\n" + "you, 2" + "\r\n" + "how, 1" + "\r\n"
                                 + "you, 2";

            //Act
            var actualOutput = WordCalculator.CalculateOccurrences(input);

            //Assert
            Assert.AreEqual(expectedOutput, actualOutput, "Invalid value returned");
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            var fileUrl = @"";

            WordCalculator.Run(fileUrl);
        }