public void Wordmatch_NotExist()
        {
            // Arrange
            string input  = "Eat";
            string output = "I love to cook and eat";
            int    count  = 0;

            // Act
            int result = RepeatCounter.CountTheWords(input, RepeatCounter.SplitTheText(output));

            // Assert
            Assert.AreEqual(count, result);
        }
        public void wordToFind_IsNotExisting()
        {
            //Arrange
            string input  = "sleep";
            string output = "This sample is a test";
            int    count  = 0;

            // Act
            int result = RepeatCounter.CountTheWords(input, RepeatCounter.SplitTheText(output));

            // Assert
            Assert.AreEqual(count, result);
        }
        public void CountTheWords_NumberOfWords()
        {
            //Arrange
            string input  = "Basketball";
            string output = "I love Basketball";
            int    count  = 1;

            // Act
            int result = RepeatCounter.CountTheWords(input, RepeatCounter.SplitTheText(output));

            //Assert
            Assert.AreEqual(count, result);
        }
        public void GetCount_ReturnsCount_Int()
        {
            // Arrange
            string        word             = "coding";
            string        sentence         = "I like coding";
            RepeatCounter newRepeatCounter = new RepeatCounter(word, sentence);

            // Act
            int result = newRepeatCounter.CountTheWords();

            // Assert
            Assert.AreEqual(1, result);
        }
Example #5
0
        public void wordSearchNeeds_MatchingWord_True()
        {
            // Arrange
            string wordSearch    = "hungry";
            string givenSentence = "I am full";
            int    result        = 0;

            // Act
            int actualResult = RepeatCounter.CountTheWords(wordSearch, userInput);

            // Assert
            Assert.AreNotEqual(result, actualResult);
        }
Example #6
0
        public void wordSearch_Returns_True()
        {
            // Arrange
            string wordSearch    = "hungry";
            string givenSentence = "I am always hungry."
                                   int result = 1;

            // Act
            int actualResult = RepeatCounter.CountTheWords(wordSearch, userInput);

            // Assert
            Assert.AreEqual(result, actualResult);
        }
Example #7
0
        public void CountTheWords_NumberOfWords()
        {
            //Arrange
            string input  = "Mochi";
            string output = "Mochi is my favorite icecream";
            int    count  = 1;

            // Act
            int result = RepeatCounter.CountTheWords(input, RepeatCounter.SplitTheText(output));

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