Пример #1
0
        public void Arrange()
        {
            _excelService = new Mock <IExcelService>();
            _formatter    = new LevyExcelTransactionFormatter(_excelService.Object);

            _transactionLine = new TransactionDownloadLine
            {
                Apprentice  = "Joe Bloggs",
                PayeScheme  = "123/ABCDE",
                Description = "Description",
                ApprenticeTrainingCourse = "Testing",
                CohortReference          = "123456",
                DateCreated           = DateTime.Now,
                EmployerContribution  = 12.8M,
                EnglishFraction       = 11.2M,
                GovermentContribution = 23.6M,
                LevyDeclared          = 12300.34M,
                PaidFromLevy          = 2000.34M,
                PeriodEnd             = "1617R4",
                TenPercentTopUp       = 200.56M,
                Total            = 345.67M,
                TrainingProvider = "Test Corp",
                TransactionType  = "Levy",
                Uln = "QWERTY"
            };
        }
        private void GenerateTransactionDescription(TransactionDownloadLine transaction)
        {
            transaction.Description = transaction.TransactionType;

            if (transaction.TransactionType.Equals("Payment", StringComparison.OrdinalIgnoreCase))
            {
                transaction.Description = transaction.TrainingProviderFormatted;
            }
            else if (transaction.TransactionType.Equals("Transfer", StringComparison.OrdinalIgnoreCase))
            {
                if (transaction.TransferSenderAccountId.Equals(transaction.AccountId))
                {
                    transaction.Description = $"Transfer sent to {transaction.TransferReceiverAccountName}";
                }
                else
                {
                    transaction.Description = $"Transfer received from {transaction.TransferSenderAccountName}";
                }
            }
        }