Exemple #1
0
        public void RepeatCounter_VerifyInputWordWithinRepeatCounter_String()
        {
            //Arrange
            RepeatCounter repeatCounter = new RepeatCounter();

            //Act
            repeatCounter.AddWord("walk");
            //Assert
            Assert.AreEqual("walk", repeatCounter.WordInput);
        }
Exemple #2
0
        public void IsAWord_ChecksToSeeIfUserWordIsInEnglishDictionary_true()
        {
            //Arrange
            RepeatCounter repeatCounter = new RepeatCounter();

            repeatCounter.AddWord("date");
            //Act
            bool wordResult = RepeatCounter.IsAWord(repeatCounter.WordInput);

            //Assert
            Assert.AreEqual(true, wordResult);
        }
Exemple #3
0
        public void WordRepeatCount_TotalsNumberOfTimesUserWordOccursInSentenceArray_integer()
        {
            //Arrange
            RepeatCounter repeatCounter = new RepeatCounter();

            repeatCounter.AddWord("walk");
            repeatCounter.AddSentence("I took my cat Walker for a walk");
            //Act
            int wordCount = repeatCounter.WordRepeatCount();

            //Assert
            Assert.AreEqual(1, wordCount);
        }
Exemple #4
0
        public void ContainsWord_SearchesForOccuranceUserWordInSentenceArray_True()
        {
            //Arrange
            RepeatCounter repeatCounter = new RepeatCounter();

            repeatCounter.AddWord("walk");
            repeatCounter.AddSentence("I took my cat Walker for a walk");
            //Act
            bool result = repeatCounter.ContainsWord();

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