Example #1
0
        public void OutputFeeData(string fileInputPath)
        {
            string fileLine = "";

            try
            {
                using (var file = new StreamReader(fileInputPath))
                {
                    while ((fileLine = file.ReadLine()) != null)
                    {
                        if (!_dataGenerator.GenerateDataFromLine(fileLine, ref _transactionData))
                        {
                            continue;
                        }

                        _transactionData.Fee = _feeCalculator.AddBasicFee(_transactionData);

                        _transactionData.Fee = _feeCalculator.AddDiscount(_transactionData);

                        _transactionData.Fee = _feeCalculator.AddMonthlyFee(_transactionData);

                        _consoleWritter.Write(_transactionData);
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("-- ERROR: " + ex.Message);
            }
        }