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 CountWords_Test() { Assert.Equal(2, CountWord.CountWords("Hello World")); }
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()); }
public void CountWord_TakesInSentence_HelloThere() { CountWord newCountWord = new CountWord("", "hello there"); Assert.AreEqual("hello there", newCountWord.UserSentence); }
public void CountWord_TakesInMultiCharacterWord_To() { CountWord newCountWord = new CountWord("to", ""); Assert.AreEqual("to", newCountWord.UserWord); }
public void CountWord_TakesInOneCharacterWord_A() { CountWord newCountWord = new CountWord("a", ""); Assert.AreEqual("a", newCountWord.UserWord); }
public void CountWord_Instantiates_NewInstance() { CountWord newCountWord = new CountWord("test", "this is only a test"); Assert.AreEqual(typeof(CountWord), newCountWord.GetType()); }