Esempio n. 1
0
        public void TextBaseToArray_SetTextBaseToArray_True()
        {
            string testPhrase = "Bird-bird, bird. Bird isn't the Word.";

            char[]      CompareTextBaseArray = testPhrase.ToLower().ToCharArray();
            WordCounter newTextBaseArray     = new WordCounter();

            newTextBaseArray.SetGuideWord("Bird-bird, bird. Bird isn't the Word.");
            char[] testTextBaseArray = newTextBaseArray.GetGuideWord();
            CollectionAssert.AreEqual(CompareTextBaseArray, testTextBaseArray);
        }
Esempio n. 2
0
        public void InputToArray_SetUserInputToArray_True()
        {
            string testBird = "Bird";

            char[]      birdArray     = testBird.ToLower().ToCharArray();
            WordCounter newGuideArray = new WordCounter();

            newGuideArray.SetGuideWord("Bird");
            char[] testGuideArray = newGuideArray.GetGuideWord();
            CollectionAssert.AreEqual(birdArray, testGuideArray);
        }
Esempio n. 3
0
        public void TextBaseArrayToListIncludingApostropheWords_SplitCharArraystoListIncludingApostropheWords_True()
        {
            //Arrange
            WordCounter TextBaseArray2 = new WordCounter();
            string      testText2      = "isn't";

            TextBaseArray2.SetGuideWord(testText2);
            char[] testArray2 = TextBaseArray2.GetGuideWord();

            TextBaseArray2.SetTextBaseWord("Bird-bird, bird. Bird isn't the Word.");
            char[] divisionTextBaseArray2 = TextBaseArray2.GetTextBaseWord();

            //Act
            TextBaseArray2.SetTextBase(divisionTextBaseArray2);
            List <char[]> newTextBase2 = TextBaseArray2.GetTextBase();

            //Assert
            CollectionAssert.AreEqual(testArray2, newTextBase2[5]);
        }
Esempio n. 4
0
        public void TextBaseArrayToList_SplitCharArraystoList_True()
        {
            //Arrange
            WordCounter TextBaseArray = new WordCounter();
            string      testText      = "Bird-bird";

            TextBaseArray.SetGuideWord(testText);
            char[] testArray = TextBaseArray.GetGuideWord();

            TextBaseArray.SetTextBaseWord("Bird-bird, bird. Bird isn't the Word.");
            char[] divisionTextBaseArray = TextBaseArray.GetTextBaseWord();

            //Act
            TextBaseArray.SetTextBase(divisionTextBaseArray);
            List <char[]> newTextBase = TextBaseArray.GetTextBase();

            //Assert
            CollectionAssert.AreEqual(testArray, newTextBase[0]);
        }