Esempio n. 1
0
        public void ArrayWithNoSpacesIsUnchanged()
        {
            //arrange
            var noSpaces = "noSpaces".ToCharArray();

            //act
            char[] result = Q1_3.GetHTMLSpaceStringFromCharArray(noSpaces, 8);

            //assert
            Assert.AreEqual(noSpaces, result);
        }
Esempio n. 2
0
        public void CanConvertMultipleSpaces()
        {
            //arrange
            var multipleSpacesBefore = "My Name is John Smith                ".ToCharArray();
            var multipleSpacesAfter  = "My%20Name%20is%20John%20Smith".ToCharArray();

            //act
            char[] result = Q1_3.GetHTMLSpaceStringFromCharArray(multipleSpacesBefore, 21);

            //assert
            CompareCharArrays(result, multipleSpacesAfter);
        }
Esempio n. 3
0
        public void CanConvertOneSpace()
        {
            //arrange
            var oneSpaceBefore = "one space        ".ToCharArray();
            var oneSpaceAfter  = "one%20space".ToCharArray();

            //act
            char[] result = Q1_3.GetHTMLSpaceStringFromCharArray(oneSpaceBefore, 9);

            //assert
            CompareCharArrays(result, oneSpaceAfter);
        }