public void GetOutgoingSingleCreditUnprocessedTestNotNull()
        {
            var outgoingSingleCredit = new OutgoingSingleCreditRepository(connectionString);
            IList<OutgoingSingleCredit> listTransactions = outgoingSingleCredit.GetAllOutgoingSingleCredit(TransactionStatus.Unprocessed);

            Assert.IsNotNull(listTransactions);
        }
        private void GetUnprocessedTransactions()
        {
            var outgoingSingleCreditRepository = new OutgoingSingleCreditRepository(config.T24ConnectionString());
            var listTransaction = outgoingSingleCreditRepository.GetAllOutgoingSingleCredit(TransactionStatus.Unprocessed);

            if (listTransaction.Count() > 0)
            {
                foreach (var item in listTransaction)
                {
                    try
                    {
                        var unprocessedTransaction = outgoingSingleCreditRepository
                                                        .ProcessOutgoingSingleCredit(item.TRN, item.Date);
                        log.Write("Transaction " + item.TRN + " has been processed");

                        GenerateTextFile(unprocessedTransaction);
                        Console.WriteLine();
                    }
                    catch (Exception ex)
                    {
                        log.Write("Transaction " + item.TRN + " failed to be processed\n" + ex.Message);
                    }
                }
            }
        }
        private void GetProcessedTransactions()
        {
            var outgoingSingleCreditRepository = new OutgoingSingleCreditRepository(config.T24ConnectionString());
            var listTransaction = outgoingSingleCreditRepository.GetAllOutgoingSingleCredit(TransactionStatus.Processed);

            if (listTransaction.Count() > 0)
            {
                foreach (var item in listTransaction)
                {
                    GenerateTextFile(item);
                    Console.WriteLine();
                }
            }
        }
        public void ProcessOutgoingSingleCreditUnprocessedTransactionsCodeValidNoTransactionRemains()
        {
            var outgoingSingleCredit = new OutgoingSingleCreditRepository(connectionString);
            var listTransactions = outgoingSingleCredit.GetAllOutgoingSingleCredit(TransactionStatus.Unprocessed);

            foreach (var item in listTransactions)
            {
                outgoingSingleCredit.ProcessOutgoingSingleCredit(item.TRN, item.Date);
            }

            var listTransactionsAfter = outgoingSingleCredit.GetAllOutgoingSingleCredit(TransactionStatus.Unprocessed)
                                            .Where(o => o.Status == TransactionStatus.Unprocessed.ToString());

            Assert.AreEqual(0, listTransactionsAfter.Count());
        }
        public void ProcessOutgoingSingleCreditTransactionsDateNull()
        {
            var outgoingSingleCredit = new OutgoingSingleCreditRepository(connectionString);

            var actual = outgoingSingleCredit.ProcessOutgoingSingleCredit("A01.FT151058V6RY", null);
        }
        public void ProcessOutgoingSingleCreditTransactionsCodeNull()
        {
            var outgoingSingleCredit = new OutgoingSingleCreditRepository(connectionString);

            var actual = outgoingSingleCredit.ProcessOutgoingSingleCredit(null, "150415");
        }
 public void UpdateGeneratedTransactionStatus(string transactionCode, OperationResult op)
 {
     try
     {
         var outgoingSingleCreditRepository = new OutgoingSingleCreditRepository(connectionString);
         outgoingSingleCreditRepository.GenerateOutgoingSingleCredit(transactionCode);
     }
     catch (Exception ex)
     {
         op.Success = false;
         op.AddMessage(ex.Message);
     }
 }