示例#1
0
 public void TestDeserializeIssue4()
 {
     using (var fs = new FileStream(@"C:\temp\testFile.txt", FileMode.Open, FileAccess.Read))
     {
         PositivePayFile deserializeResults = FixedWidthSerializer.Deserialize <PositivePayFile>(fs);
     }
 }
示例#2
0
        public void LargeFileText()
        {
            PositivePayFile pf;

            using (var fs = new FileStream(@"C:\temp\pos_AP_20200212211501813.txt", FileMode.Open, FileAccess.Read))
            {
                pf = FixedWidthSerializer.Deserialize <PositivePayFile>(fs);
            }
            Debug.WriteLine(pf.CheckGroups.Sum(cg => cg.Records.Length));
            //string serializedData = FixedWidthSerializer.Serialize(pf);
        }
示例#3
0
        public void TestDeserializeWfFile()
        {
            var actualFile = FixedWidthSerializer.Deserialize <PositivePayFile>(Properties.Resources.pos_AP_20200207211501810);

            var expectedFile = new PositivePayFile
            {
                Header = new FileHeader
                {
                    AccountNumber = 5555333111,
                    BankID        = 164
                },
                CheckGroups = new[]
                {
                    new CheckGroup
                    {
                        Records = new []
                        {
                            new CheckRecord
                            {
                                CheckSerial   = 19983,
                                AccountNumber = 5555333111,
                                Amount        = 1050.00m,
                                IssueDate     = new DateTime(2020, 02, 03),
                                Payee         = "T & T TESTPAYEE, L.P"
                            }
                        },
                        Trailer = new CheckGroupTrailer
                        {
                            RecordCount = 1,
                            TotalAmount = 1050.00m
                        }
                    }
                }
            };

            //Assert.AreEqual(13, FixedWidthSerializer.CacheSize);
            Assert.IsTrue(expectedFile.ObjectEquals(actualFile));
        }