Esempio n. 1
0
        public void ShouldBeAbleToCountNumberOfLettersInSimpleSentence()
        {
            // Arrange
            var sentenceToScan = "TDD is awesome!";
            var characterToScanFor = "e";
            var expectedResult = 2;
            var stringUtils = new StringUtils();

            // Act
            int result = stringUtils.FindNumberOfOccurences(sentenceToScan, characterToScanFor);

            // Assert
            Assert.AreEqual(expectedResult, result);
        }
Esempio n. 2
0
        public void ShouldBeAbleToCountNumberOfLettersInAComplexSentence()
        {
            // Arrange
            var sentenceToScan = "Once is unique, twice is a coincidence, three times is a pattern.";
            var characterToScanFor = "n";
            var expectedResult = 5;
            var stringUtils = new StringUtils();

            //Act
            int result = stringUtils.FindNumberOfOccurences(sentenceToScan, characterToScanFor);

            // Assert
            Assert.AreEqual(expectedResult, result);
        }