public void GetWord_ReturnWord_String() { string wordInput = "coffee"; WordSentence newWordSentence = new WordSentence("coffee", "test"); string result = newWordSentence.GetWord(); Assert.AreEqual(wordInput, result); }
public void SetWord_InputStringWord_String() { string oldWordInput = "coffee"; WordSentence newWordSentence = new WordSentence(oldWordInput, "test"); string newWord = "car"; newWordSentence.SetWord(newWord); string result = newWordSentence.GetWord(); Assert.AreEqual(newWord, result); }
public void WordInSentence_WordNotInSentence_0() { //Arrange WordSentence newWordSentence = new WordSentence("tea", "I like coffee"); string wordInput = newWordSentence.GetWord(); string sentenceInput = newWordSentence.GetSentence(); RepeatCounter newRepeatCounter = new RepeatCounter(wordInput, sentenceInput); //Act int result = newRepeatCounter.WordInSentence(); //Assert Assert.AreEqual(0, result); }
public void WordInSentence_DoNotCountWordsContainedInWords_Int() { //Arrange WordSentence newWordSentence = new WordSentence("read", "Are you ready??"); string wordInput = newWordSentence.GetWord(); string sentenceInput = newWordSentence.GetSentence(); RepeatCounter newRepeatCounter = new RepeatCounter(wordInput, sentenceInput); //Act int result = newRepeatCounter.WordInSentence(); //Assert Assert.AreEqual(0, result); }
public void WordInSentence_CountsWordsByPunctuation_Int() { //Arrange WordSentence newWordSentence = new WordSentence("hungry", "Are you Hungry??"); string wordInput = newWordSentence.GetWord(); string sentenceInput = newWordSentence.GetSentence(); RepeatCounter newRepeatCounter = new RepeatCounter(wordInput, sentenceInput); //Act int result = newRepeatCounter.WordInSentence(); //Assert Assert.AreEqual(1, result); }
public void WordInSentence_CountWordsInSentence_Int() { //Arrange WordSentence newWordSentence = new WordSentence("car", "My car is faster than your car"); string wordInput = newWordSentence.GetWord(); string sentenceInput = newWordSentence.GetSentence(); RepeatCounter newRepeatCounter = new RepeatCounter(wordInput, sentenceInput); //Act int result = newRepeatCounter.WordInSentence(); //Assert Assert.AreEqual(2, result); }