Esempio n. 1
0
        public void UserParagraph_SplitParagraph_True()
        {
            //Arrange
            string newParagraph = "oh boy, i sure love pizza";

            string[] array    = { "oh", "boy,", "i", "sure", "love", "pizza" };
            words    newWords = new words();

            //Act
            newWords.SetParagraph(newParagraph);
            newWords.GetParagraph();
            string[] result = newWords.Split();
            //Assert
            CollectionAssert.AreEqual(array, result);
            Console.WriteLine(result);
        }
Esempio n. 2
0
        public void UserParagraph_Compare_True()
        {
            //Arrange
            string newWord      = "pizza";
            string newParagraph = "oh boy, i sure love pizza";
            words  newWords     = new words();

            //Act
            newWords.SetWord(newWord);
            newWords.SetParagraph(newParagraph);
            string testWord = newWords.GetWord();

            string[] testPara = newWords.Split();
            int      result   = newWords.Compare(testWord, testPara);

            //Assert
            Assert.AreEqual(result, 1);
        }