Beispiel #1
0
        public void Transform_TextWithLeadingAndTrailingSpaces_TrimmedTextReturned()
        {
            var value            = " test ";
            var trimEndAttribute = new TrimEndAttribute();
            var transformedValue = trimEndAttribute.Transform(value);

            Assert.AreEqual(" test", transformedValue);
        }
Beispiel #2
0
        public void Transform_TextWithMultipleButDifferentLeadingAndTrailingTrimmableChars_TrimmedTextReturned()
        {
            var value            = " 0 test 0 ";
            var trimEndAttribute = new TrimEndAttribute('0', ' ');
            var transformedValue = trimEndAttribute.Transform(value);

            Assert.AreEqual(" 0 test", transformedValue);
        }
Beispiel #3
0
        public void Transform_TextWithTrailingZeroesAndZeroTrimChar_TrimmedTextReturned()
        {
            var value            = "test0";
            var trimEndAttribute = new TrimEndAttribute('0');
            var transformedValue = trimEndAttribute.Transform(value);

            Assert.AreEqual("test", transformedValue);
        }
Beispiel #4
0
        public void Transform_TextWithTrailingSpacesAndNonSpaceTrimChar_OriginalTextReturned()
        {
            var value            = "test ";
            var trimEndAttribute = new TrimEndAttribute('0');
            var transformedValue = trimEndAttribute.Transform(value);

            Assert.AreEqual("test ", transformedValue);
        }
Beispiel #5
0
        public void Transform_EmptyText_EmptyTextReturned()
        {
            var value            = String.Empty;
            var trimEndAttribute = new TrimEndAttribute();
            var transformedValue = trimEndAttribute.Transform(value);

            Assert.AreEqual(String.Empty, transformedValue);
        }
Beispiel #6
0
 public void Transform_NullValue_EmptyTextReturned()
 {
     var trimEndAttribute = new TrimEndAttribute();
     var transformedValue = trimEndAttribute.Transform(null);
 }