Ejemplo n.º 1
0
        public void TestSpaces()
        {
            const string text1    = " text1 ";
            const string text2    = " text2 ";
            const string expected = "text1 text2";
            Phrase       phrase   = new Phrase();
            Word         word1    = new Word(text1);
            Word         word2    = new Word(text2);

            phrase.AddWord(word1);
            phrase.AddWord(word2);
            string actual = phrase.GetPhrase();

            Assert.Equal(expected, actual);
        }
        public void TestSpaces()
        {
            const string text1    = " text1 ";
            const string text2    = " text2 ";
            const string expected = "text1 text2";
            Phrase       phrase   = new Phrase();
            Word         word1    = new Word(text1); //Con arreglar el set con la función Trim se quitan los espacios anteriores y posteriores
            Word         word2    = new Word(text2);

            phrase.AddWord(word1);
            phrase.AddWord(word2);
            string actual = phrase.GetPhrase(); // Con Trim tambien quitamos los espacios anteriores

            Assert.Equal(expected, actual);
        }
Ejemplo n.º 3
0
        public void TestAddRemoveWord()
        {
            Phrase phrase = new Phrase();
            Word   word   = new Word("Test");

            phrase.AddWord(word);
            phrase.RemoveWord(word);
        }