public Sage50SessionController(Session.Session session, ISage50TransactionGetter transactionGetter, ISage50ConnectionFactory connectionFactory, Sage50DataDirectoryStorage dataDirectoryStorage, DisplayFieldProvider displayFieldProvider)
 {
     this.session              = session;
     this.transactionGetter    = transactionGetter;
     this.connectionFactory    = connectionFactory;
     this.dataDirectoryStorage = dataDirectoryStorage;
     this.displayFieldProvider = displayFieldProvider;
 }
        public void OnlyShowsSpecifiedFields()
        {
            var provider = new DisplayFieldProvider();
            var actual   = GetExportedText("An illuminating comment", transactions, new[] { provider.TransactionDate, provider.Username, provider.NominalCode, provider.LedgerEntryType, provider.Amount });

            var expected =
                @"An illuminating comment
Transaction date,Username,Nominal Code,Dr/Cr,Amount
2012-03-04,alf,9012,Cr,23.4
2012-03-04,alf,3001,Dr,23.4
2012-06-05,steve,8014,Cr,12.4
2012-06-05,steve,4001,Dr,12.4
";

            Assert.AreEqual(expected, actual);
        }
        public void CanOutputAllFieldsSuccessfully()
        {
            var provider = new DisplayFieldProvider();
            var actual   = GetExportedText("What we did to get these transactions", transactions, provider.AllFields.ToList());

            var expected =
                @"What we did to get these transactions
Transaction ID,Transaction date,Transaction type,Description,Username,Nominal Code,Nominal name,Dr/Cr,Amount
id 1,2012-03-04,SI,very interesting transaction,alf,9012,Expenses,Cr,23.4
id 1,2012-03-04,SI,very interesting transaction,alf,3001,Cash,Dr,23.4
id 2,2012-06-05,UJ,perfectly normal transaction,steve,8014,Depreciation,Cr,12.4
id 2,2012-06-05,UJ,perfectly normal transaction,steve,4001,Fixed assets,Dr,12.4
";

            Assert.AreEqual(expected, actual);
        }
Exemple #4
0
 public FieldLookupInterpreter(ExcelColumnNamer namer, SearchActionProvider actionProvider, DisplayFieldProvider displayFieldProvider)
 {
     this.namer                = namer;
     this.actionProvider       = actionProvider;
     this.displayFieldProvider = displayFieldProvider;
 }