Encode C# objects to EBCDIC
Beispiel #1
0
        public void EbcdicTestsTest()
        {
            FieldFormat binary = new FieldFormat
            {
                Decimal = 0,
                Size = "6",
                Type = "B"
            };
            EbcdicEncoder encoder = new EbcdicEncoder("ascii");
            EbcdicDecoder decoder = new EbcdicDecoder("ascii");

            decimal value1 = -1937m;
            decimal value2 = 1937m;
            Assert.AreEqual(value1, decoder.Decode(encoder.Encode(value1, binary), binary));
            Assert.AreEqual(value2, decoder.Decode(encoder.Encode(value2, binary), binary));
        }
 public void Before()
 {
     _encoder = new EbcdicEncoder("ascii");
 }