public void CountHyphensWhenThereAreOnlySpaces() { var sentence = "my sentence is only spaces"; var calculator = new HyphensCalculator(); var countHyphens = calculator.Count(sentence); Assert.AreEqual((uint)4, countHyphens); }
public void GetStatistics_WithoutHyphens_ReturnCorrectCounting(string textQuery, int expectingWords) { //Arrange ICountingStatisticCalculator hyphensCalculator = new HyphensCalculator(); //Action ITextCountingStatistic result = hyphensCalculator.GetStatistics(textQuery); //Assert Assert.True(result.GetCount() == expectingWords); }
public TextStatistics Statistics(string text) { if (text == null) { throw new ArgumentNullException("Input text is null."); } var hyphensCalculator = new HyphensCalculator(); var wordsCalculator = new WordsCalculator(); var spacesCalculator = new SpacesCalculator(); return(new TextStatistics() { HyphensCount = hyphensCalculator.Count(text), SpacesCount = spacesCalculator.Count(text), WordsCount = wordsCalculator.Count(text) }); }