Example #1
0
        public void CheckForTabsAndRemoveThemFromString()
        {
            string input    = "abc\t ";
            string expected = "abc";
            var    actual   = TrimSpaces.CheckForWhiteSpace(input);

            Assert.AreEqual(expected, actual);
        }
Example #2
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);
        }
Example #3
0
        public void KeepsWhitespaceAtBeginningOfString()
        {
            string input    = "   abc    ";
            string expected = "   abc";
            var    actual   = TrimSpaces.CheckForWhiteSpace(input);

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

            Assert.AreEqual(expected, actual);
        }
Example #5
0
        public void CheckForNoWhitespace_InAString()
        {
            string input    = "abc";
            string expected = "abc";
            var    actual   = TrimSpaces.CheckForWhiteSpace(input);

            Assert.AreEqual(expected, actual);
        }
Example #6
0
        public void CheckIfAStringIsEmpty_ReturnException()
        {
            string input = "";

            Assert.Throws <System.ArgumentException>(() => TrimSpaces.CheckForWhiteSpace(input));
        }
Example #7
0
        public void CheckIfAStringIsNull_ReturnException()
        {
            string input = null;

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