public void Properties_CheckPropertySentence_string()
        {
            //Arrange
            string testSentence    = "Sentence";
            Word   testWordCounter = new Word("Word", "Sentence");
            //Act
            string result = testWordCounter.GetSentence();

            //Assert
            Assert.AreEqual(testSentence, 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);
 }