public TransactionController(IMapper mapper, ITransactionReader transactionReader, ITransactionImporter transactionImporter, IFileParser fileParser) { _mapper = mapper; _fileParser = fileParser; _transactionReader = transactionReader; _transactionImporter = transactionImporter; }
public TransactionReaderTests() { _transactionParserMock = new Mock <ITransactionParser>(); var transaction = new Transaction { Size = Constants.Sizes.Medium, Date = DateTime.UtcNow, ShippingPrice = Constants.ShippingPrices.Medium.LaPoste, ShippingProvider = Constants.Providers.LaPoste, Discount = new decimal(0.5) }; _transactionParserMock.Setup(p => p.ParseTransaction(It.IsAny <string>())) .Returns(transaction); _transactionReader = new TransactionReader(_transactionParserMock.Object); }
private static IEnumerable <Transaction> LoadTransactions(string path) { var fileName = Path.GetFileName(path); var result = new List <Transaction>(); var reverseResult = false; ITransactionReader reader = null; try { if (fileName.StartsWith("CSV_O_")) { Console.WriteLine("Detected Rabobank file."); reader = new RabobankTransactionReader(File.OpenText(path)); } else { Console.WriteLine("Detected ING file."); reader = new INGTransactionReader(File.OpenText(path)); reverseResult = true; } Transaction transaction; while ((transaction = reader.ReadTransaction()) != null) { result.Add(transaction); } } finally { reader?.Dispose(); } if (reverseResult) { result.Reverse(); } return(result); }
public TransactionsController(ITransactionReader transactionReader) { _transactionReader = transactionReader; }
public ColumnFinder(ITransactionReader transactionReader) { this.transactionReader = transactionReader; }
public void SetTransactionReader(ITransactionReader reader) => _reader = reader;
public NonInvestmentTransactionRepository(ITransactionReader reader) { _reader = reader; }
public TransactionSelector(ITransactionReader transactionReader, ITransactionFeeWriter transactionFeeWriter, ITransactionCharger transactionCharger) { _transactionReader = transactionReader; _transactionFeeWriter = transactionFeeWriter; _transactionCharger = transactionCharger; }
public TransactionReaderTests() { _fileReaderMock = new Mock <IFileReader>(MockBehavior.Strict); _transactionFormatterMock = new Mock <ITransactionFormatter>(MockBehavior.Strict); _sut = new TransactionReader(_fileReaderMock.Object, _transactionFormatterMock.Object); }