Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo n.º 4
0
        public void RemoveWhiteSpacesAtEndOfString()
        {
            string input    = "abc    ";
            string expected = "abc";
            var    actual   = TrimSpaces.CheckForWhiteSpace(input);

            Assert.AreEqual(expected, actual);
        }
Exemplo 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);
        }
Exemplo n.º 6
0
        public void CheckForNoWhitespace_InAString()
        {
            string input    = "abc";
            string expected = "abc";
            var    actual   = TrimSpaces.CheckForWhiteSpace(input);

            Assert.AreEqual(expected, actual);
        }
Exemplo 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);
        }
Exemplo n.º 8
0
        public void KeepsWhitespaceAtBeginningOfString()
        {
            string input    = "   abc    ";
            string expected = "   abc";
            var    actual   = TrimSpaces.CheckForWhiteSpace(input);

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

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

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