public void Properties_CheckPropertyWord_string() { //Arrange string testWord = "Word"; Word testWordCounter = new Word("Word", "Sentence"); //Act string result = testWordCounter.GetWord(); //Assert Assert.AreEqual(testWord, result); }
public bool StringContains(Word word) { string[] array = word.GetSentence().Split(' '); foreach (string sentence in array) { if (word.GetWord() == sentence) { return(true); } } return(false); }
public int RepeatCounter(Word word) { if (StringContains(word)) { _matchCounter = 0; string[] sentenceArray1 = word.GetSentence().Split(' '); foreach (string sentence in sentenceArray1) { if (word.GetWord() == sentence) { _matchCounter += 1; } } } else { return(0); } return(_matchCounter); }
public string ReturnWord(Word word) { return(word.GetWord()); }