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);
        }
예제 #2
0
 public bool StringContains(Word word)
 {
     string[] array = word.GetSentence().Split(' ');
     foreach (string sentence in array)
     {
         if (word.GetWord() == sentence)
         {
             return(true);
         }
     }
     return(false);
 }
예제 #3
0
 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);
 }
예제 #4
0
 public string ReturnWord(Word word)
 {
     return(word.GetWord());
 }