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);
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 4
0
 public string ReturnWord(Word word)
 {
     return(word.GetWord());
 }