Esempio n. 1
0
        public void InputOfNewLineInAString_ReturnsANewLine()// input returns a new line char
        {
            string input    = "\r\n";
            string expected = "\r\n";
            var    actual   = TrimSpaces.CheckForWhiteSpace(input);

            Assert.AreEqual(expected, actual);
        }
Esempio n. 2
0
        public void CheckForTabsAndRemoveThemFromString()// check for tabs and remove
        {
            string input    = "abc\t ";
            string expected = "abc";
            var    actual   = TrimSpaces.CheckForWhiteSpace(input);

            Assert.AreEqual(expected, actual);
        }
Esempio n. 3
0
        public void RemoveWhiteSpaceAtTheEndOfSecondLine()// remove white space at the end of string
        {
            string input    = "abc\r\n cd \r\n";
            string expected = "abc\r\ncd\r\n";
            var    actual   = TrimSpaces.CheckForWhiteSpace(input);

            Assert.AreEqual(expected, actual);
        }
Esempio n. 4
0
        public void RemoveWhiteSpacesAtEndOfString()
        {
            string input    = "abc    ";
            string expected = "abc";
            var    actual   = TrimSpaces.CheckForWhiteSpace(input);

            Assert.AreEqual(expected, actual);
        }
Esempio n. 5
0
        public void KeepsWhitespaceAtBeginningOfString()// this test should retain white space at the beginning of a string
        {
            string input    = "      abc    ";
            string expected = "      abc";
            var    actual   = TrimSpaces.CheckForWhiteSpace(input);

            Assert.AreEqual(expected, actual);
        }
Esempio n. 6
0
        public void CheckForNoWhitespace_InAString()
        {
            string input    = "abc";
            string expected = "abc";
            var    actual   = TrimSpaces.CheckForWhiteSpace(input);

            Assert.AreEqual(expected, actual);
        }
Esempio n. 7
0
        public void RemoveWhiteSpaceInMiddleOfString()
        {
            string input    = "abc\r\n cd \r\n ";
            string expected = "abc\r\ncd\r\n";
            var    actual   = TrimSpaces.CheckForWhiteSpace(input);

            Assert.AreEqual(expected, actual);
        }
Esempio n. 8
0
        public void KeepsWhitespaceAtBeginningOfString()
        {
            string input    = "   abc    ";
            string expected = "   abc";
            var    actual   = TrimSpaces.CheckForWhiteSpace(input);

            Assert.AreEqual(expected, actual);
        }
Esempio n. 9
0
        public void CheckIfAStringIsEmpty_ReturnException()
        {
            string input = "";

            Assert.Throws <System.ArgumentException>(() => TrimSpaces.CheckForWhiteSpace(input));
        }
Esempio n. 10
0
        public void CheckIfAStringIsNull_ReturnException()
        {
            string input = null;

            Assert.Throws <System.NullReferenceException>(() => TrimSpaces.CheckForWhiteSpace(input));
        }