public void RepeatCounter_CalculatesZeroWhenNoMatch_Int() { string sent = "There is a rat over there"; string word = "than"; RepeatCounter testCounter = new RepeatCounter(sent, word); Assert.AreEqual(0, testCounter.GetCount()); }
public void RepeatCounter_DoesntCountPartialMatches_Int() { string sent = "There is a ratrat rat rat over there"; string word = "rat"; RepeatCounter testCounter = new RepeatCounter(sent, word); Assert.AreEqual(2, testCounter.GetCount()); }
public void RepeatCounter_PropertiesAreSet_StringStringInt() { string sent = "There is a rat over there"; string word = "there"; RepeatCounter testCounter = new RepeatCounter(sent, word); Assert.AreEqual(sent, testCounter.Sentence); Assert.AreEqual(word, testCounter.Word); Assert.AreEqual(2, testCounter.GetCount()); }
public void SetCount_HandlePunctuation_Void() { //arrange int controlCount = 2; RepeatCounter newCounter = new RepeatCounter("cat", "There is a Cat over there. It is a big cat."); //act newCounter.SetCount(); //assert Assert.AreEqual(controlCount, newCounter.GetCount()); }
public void CountWord3() { //Arrange string firstWord = "Fish"; string enterSentence = "Fish Fish Fish in the sea Fishery"; int outPut = 3; RepeatCounter wordCount = new RepeatCounter(firstWord, enterSentence); //Act wordCount.CountWord(); //Assert Assert.AreEqual(outPut, wordCount.GetCount()); }
public void CountWord2() { //Arrange string firstWord = "Pig"; string enterSentence = "Two little Pig Pig in the barn"; int outPut = 2; RepeatCounter wordCount = new RepeatCounter(firstWord, enterSentence); //Act wordCount.CountWord(); //Assert Assert.AreEqual(outPut, wordCount.GetCount()); }
public void CountWord() { //Arrange string firstWord = "Salmon"; string enterSentence = "Salmon"; int outPut = 1; RepeatCounter wordCount = new RepeatCounter(firstWord, enterSentence); //Act wordCount.CountWord(); //Assert Assert.AreEqual(outPut, wordCount.GetCount()); }
public void CountWordFrequency5_ReturnFrequencyOfWordInSentence() { // arrange string word = "chocolate"; string sentence = "I love chocolate, chocolate ice cream, chocolate candy bar, and anything chocolate"; int count = 4; RepeatCounter repeatCounter = new RepeatCounter(word, sentence); // act int expectedResult = repeatCounter.GetCount(); // assert Assert.AreEqual(count, expectedResult); }
public void CountWordFrequency4_ReturnFrequencyOfWordInSentence() { // arrange string word = "he"; string sentence = "He is over there"; int count = 1; RepeatCounter repeatCounter = new RepeatCounter(word, sentence); // act int expectedResult = repeatCounter.GetCount(); // assert Assert.AreEqual(count, expectedResult); }
public void CountWordFrequency3_ReturnFrequencyOfWordInSentence() { // arrange string word = "I"; string sentence = "I am what i eat"; int count = 2; RepeatCounter repeatCounter = new RepeatCounter(word, sentence); // act int expectedResult = repeatCounter.GetCount(); // assert Assert.AreEqual(count, expectedResult); }
public void SetValues_SetWordSentenceAndCount_Void() { //arrange string newWord = "small"; string newSentence = "There is a small cat over there."; int newCount = 1; RepeatCounter newCounter = new RepeatCounter("cat", "There is a cat over there. It is a big cat that I will pet."); //act newCounter.SetWord(newWord); newCounter.SetSentence(newSentence); newCounter.SetCount(); //assert Assert.AreEqual(newWord, newCounter.GetWord()); Assert.AreEqual(newSentence, newCounter.GetSentence()); Assert.AreEqual(newCount, newCounter.GetCount()); }
public void GetValues_FetchWordSentenceAndCount_String() { //arrange string controlWord = "cat"; string controlSentence = "There is a cat over there. It is a big cat that I will pet."; int controlCount = 2; RepeatCounter newCounter = new RepeatCounter("cat", "There is a cat over there. It is a big cat that I will pet."); newCounter.SetCount(); //act string wordResult = newCounter.GetWord(); string sentenceResult = newCounter.GetSentence(); int countResult = newCounter.GetCount(); //assert Assert.AreEqual(wordResult, controlWord); Assert.AreEqual(sentenceResult, controlSentence); Assert.AreEqual(countResult, controlCount); }