public static void Start() { Console.WriteLine("Please enter a sentence:"); string usersentence = Console.ReadLine(); Console.WriteLine("Please enter a word to check:"); string userword = Console.ReadLine(); CountWord newCountWord = new CountWord(userword, usersentence); int result = newCountWord.CountRepeat(); Console.WriteLine("The word " + userword + " appears " + result + " time(s) in the sentence."); }
public void CountRepeat_CountsOnlyFullWord_2() { CountWord newCountWord = new CountWord("cat", "cat cathedral cat"); Assert.AreEqual(2, newCountWord.CountRepeat()); }
public void CountRepeat_CountsWordsInSentence_1() { CountWord newCountWord = new CountWord("eggs", "eggs are one of my favorite breakfast food yay eggs"); Assert.AreEqual(2, newCountWord.CountRepeat()); }