Beispiel #1
0
        public void Transform_NullValue_PaddedValueReturned()
        {
            var totalWidth        = 5;
            var paddingChar       = '0';
            var padRightAttribute = new PadRightAttribute(totalWidth, paddingChar);
            var transformedValue  = padRightAttribute.Transform(null);

            Assert.AreEqual("00000", transformedValue);
        }
Beispiel #2
0
        public void Transform_FullLengthValue_OriginalValueReturned()
        {
            var value             = "11111";
            var totalWidth        = 5;
            var paddingChar       = '0';
            var padRightAttribute = new PadRightAttribute(totalWidth, paddingChar);
            var transformedValue  = padRightAttribute.Transform(value);

            Assert.AreEqual(value, transformedValue);
        }
Beispiel #3
0
        public void Transform_UnderTotalLengthValue_PaddedValueReturned()
        {
            var value             = "111";
            var totalWidth        = 5;
            var paddingChar       = '0';
            var padRightAttribute = new PadRightAttribute(totalWidth, paddingChar);
            var transformedValue  = padRightAttribute.Transform(value);

            Assert.AreEqual("11100", transformedValue);
        }