public void GetSentence_ReturnSentence_String() { string sentenceInput = "I like coffee."; WordSentence newWordSentence = new WordSentence("test", "I like coffee."); string result = newWordSentence.GetSentence(); Assert.AreEqual(sentenceInput, result); }
public void SetSentence_InputStringSentence_String() { string oldSentenceInput = "I like coffee."; WordSentence newWordSentence = new WordSentence("test", oldSentenceInput); string newSentence = "My car is a fast car."; newWordSentence.SetSentence(newSentence); string result = newWordSentence.GetSentence(); Assert.AreEqual(newSentence, 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); }