public void TestIifParser()
 {
     using (var parser = new CommonUtils.FileFormatParsers.QuickbooksIifParser())
     {
         DataSet d = parser.Parse(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"IifTestFile.iif"));
         Assert.IsTrue(d.Tables.Count > 2);
     }
 }
Beispiel #2
0
 public void TestIifParser()
 {
     using (var parser = new CommonUtils.FileFormatParsers.QuickbooksIifParser())
     {
         DataSet d = parser.Parse(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"IifTestFile.iif"));
         Assert.IsTrue(d.Tables.Count > 2);
     }
 }
Beispiel #3
0
 public IEnumerable <IEnumerable <KeyValuePair <string, string> > > GetTransactionProperties()
 {
     using (var parser = new CommonUtils.FileFormatParsers.QuickbooksIifParser())
     {
         using (var iiSet = parser.Parse(this.filePath))
         {
             var dataColumns = new DataColumn[iiSet.Tables["TRNS"].Columns.Count];
             iiSet.Tables["TRNS"].Columns.CopyTo(dataColumns, 0);
             var columns = dataColumns.Select(dc => dc.ColumnName.ToLowerInvariant().Trim()).ToArray();
             var rows    = iiSet.Tables["TRNS"].Rows;
             for (var rowIndex = 0; rowIndex < rows.Count; rowIndex++)
             {
                 yield return(dataColumns.Select((dc, i) => new KeyValuePair <string, string>(columns[i],
                                                                                              CleanValue(rows[rowIndex][dc]))));
             }
         }
     }
 }