public static void Main() { Console.WriteLine("Welcome to the Word Test"); Console.WriteLine("Please input a sentance"); string userSentence = Console.ReadLine(); Console.WriteLine("Please input what word you would like to check"); string userWord = Console.ReadLine(); RepeatWordCounter newCounter = new RepeatWordCounter(userWord, userSentence); Console.WriteLine($"your word appears {newCounter.SentenceCheckWord()} times in your sentance"); }
public void RepeatWordCounter_ReturnsCountofMatchingWordsinSentence_SentenceCheckWord() { RepeatWordCounter newCounter = new RepeatWordCounter("Hello", "Hello There Hello"); Assert.AreEqual(newCounter.SentenceCheckWord(), 2); }
// Test to check for Word input no longer vaild public void RepeatWordCounter_TakesSentenceAndMakesAnArray_SentenceCheckWord() { RepeatWordCounter newCounter = new RepeatWordCounter("Hello", "Hello There"); Assert.AreEqual(newCounter.SentenceCheckWord(), "hello"); }