Exemplo n.º 1
0
        public void Valid3_all_empty()
        {
            var rec = new ValidFixedRecord();

            var result = rec.ToFixedRecord();

            result.ShouldBe("          ");
        }
Exemplo n.º 2
0
        public void Valid2_Empty_property_replaced_with_whitespace()
        {
            var rec = new ValidFixedRecord();
            rec.Column1 = "a";
            rec.Column3 = "c";
            rec.Column4 = "d";
            var result = rec.ToFixedRecord();

            result.ShouldBe("a     c  d");
        }
Exemplo n.º 3
0
        public void Valid1_all_properties()
        {
            var rec = new ValidFixedRecord();
            rec.Column1 = "a";
            rec.Column2 = "b";
            rec.Column3 = "c";

            var result = rec.ToFixedRecord();

            result.ShouldBe("a  b  c   ");
        }
Exemplo n.º 4
0
        public void Value_overflow_throws_exception()
        {
            var rec = new ValidFixedRecord();

            rec.Column1 = "hello world";

            var ex = Should.Throw<ArgumentException>(() => rec.ToFixedRecord());
            ex.Message.ShouldContain("is longer");
        }