Ejemplo n.º 1
0
        public void GetFullStringMethod_RecursiveSubStrings()
        {
            //arrange
            const string firstSubString       = "this";
            ColorString  firstColorSubString  = new ColorString(firstSubString, ConsoleColor.Red);
            const string secondSubString      = "is";
            ColorString  secondColorSubString = new ColorString(secondSubString, ConsoleColor.Blue);

            ColorString firstCompositeSubString = new ColorString(firstColorSubString, secondColorSubString);

            const string thirdSubString       = "a";
            ColorString  thirdColorSubString  = new ColorString(thirdSubString, ConsoleColor.Green);
            const string fourthSubString      = "test";
            ColorString  fourthColorSubString = new ColorString(fourthSubString, ConsoleColor.Yellow);
            const string fifthSubString       = "!";
            ColorString  fifthColorSubString  = new ColorString(fifthSubString, ConsoleColor.White);

            ColorString secondCompositeSubString = new ColorString(thirdColorSubString, fourthColorSubString, fifthColorSubString);

            const string expectedFullString = firstSubString + secondSubString + thirdSubString + fourthSubString + fifthSubString;
            ColorString  colorString        = new ColorString(firstCompositeSubString, secondCompositeSubString);

            //act
            string actualString = colorString.GetFullString();

            //assert
            Assert.AreEqual(expectedFullString, actualString);
        }
Ejemplo n.º 2
0
        public void GetFullStringMethod_NoSubstrings()
        {
            //arrange
            const string expectedFullString = "you've got to fight, for your right, to party!";
            ColorString  colorString        = new ColorString(expectedFullString);

            //act
            string actualString = colorString.GetFullString();

            //assert
            Assert.AreEqual(expectedFullString, actualString);
        }
Ejemplo n.º 3
0
        public void GetFullStringMethod_SubStrings()
        {
            //arrange
            const string firstSubString  = "you've got to fight, ";
            const string secondSubString = "for your right, ";
            const string thirdSubString  = "to party!";

            const string expectedFullString = firstSubString + secondSubString + thirdSubString;
            ColorString  colorString        = new ColorString(firstSubString, secondSubString, thirdSubString);

            //act
            string actualString = colorString.GetFullString();

            //assert
            Assert.AreEqual(expectedFullString, actualString);
        }