public void WithoutSupplementaryDetailsOrServiceReference_IsParsedCorrectly()
        {
            var expectedTransaction = ExpectedSwiftTransaction.CreateExpected(new DateTime(2015, 1, 26), DebitCredit.Credit,
                                                                              "R", "EUR", 18790.00M, "NTRF", "PON0000002534162", null, "", "");

            var transaction = new Transaction("1501260126CR18790,00NTRFPON0000002534162", new Currency("EUR"), Mt940Test.NlCultureInfo);

            ExpectedSwiftTransaction.AssertTransaction(expectedTransaction, transaction);
        }
Exemplo n.º 2
0
        public void WithSupplementaryDetailsAndServiceReference_IsParsedCorrectly()
        {
            var expectedTransaction = ExpectedSwiftTransaction.CreateExpected(new DateTime(2015, 1, 26), DebitCredit.Credit,
                                                                              "R", "GBP", 18790.00M, "NTRF", "PON0000002534162", null, "Inward Payment", "GBG260150R2ETGXS");

            var transaction = new Transaction("1501260126CR18790.00NTRFPON0000002534162//GBG260150R2ETGXS\r\nInward Payment", new Currency("GBP"), Mt940Test.GbCultureInfo);

            ExpectedSwiftTransaction.AssertTransaction(expectedTransaction, transaction);
        }
 public static void AssertCustomerStatementTransactions(CustomerStatementMessage message,
                                                        List <ExpectedSwiftTransaction> expectedTransactions)
 {
     Assert.That(message.Transactions.Count, Is.EqualTo(expectedTransactions.Count), "Correct number of transactions.");
     for (var i = 0; i < expectedTransactions.Count(); i++)
     {
         var expected = expectedTransactions[i];
         var actual   = message.Transactions.ToList()[i];
         ExpectedSwiftTransaction.AssertTransaction(expected, actual);
     }
 }
Exemplo n.º 4
0
 public static void AssertTransaction(ExpectedSwiftTransaction expected, Transaction actual)
 {
     Assert.That(actual.Amount.Value, Is.EqualTo(expected.Amount), "Amount matches.");
     Assert.That(actual.Amount.Currency.Code, Is.EqualTo(expected.CurrencyCode), "CurrencyCode matches.");
     Assert.That(actual.DebitCredit, Is.EqualTo(expected.DebitCredit), "DebitCredit matches.");
     Assert.That(actual.Description, Is.EqualTo(expected.Description), "Description matches.");
     Assert.That(actual.FundsCode, Is.EqualTo(expected.FundsCode), "FundsCode matches.");
     Assert.That(actual.Reference, Is.EqualTo(expected.Reference), "Reference matches.");
     Assert.That(actual.TransactionType, Is.EqualTo(expected.TransactionType), "TransactionType matches.");
     Assert.That(actual.ValueDate, Is.EqualTo(expected.ValueDate), "ValueDate matches.");
     Assert.That(actual.SupplementaryDetails, Is.EqualTo(expected.SupplementaryDetails), "SupplementaryDetails matches.");
     Assert.That(actual.AccountServicingReference, Is.EqualTo(expected.AccountServicingReference),
                 "AccountServicingReference matches.");
 }
        public void StandardBankTransactionsGb()
        {
            var expectedTransactions = new List <ExpectedSwiftTransaction>();

            expectedTransactions.Add(ExpectedSwiftTransaction.CreateExpected(new DateTime(2015, 1, 26), DebitCredit.Debit,
                                                                             "R", "GBP", 52.58M, "NTRF", "ITM1234567890123", "yyyyyyyyyyyyyyyyy\r\nBasel\r\nCHF 50.00   0.950932 on 23/01/2015", "Visa"));

            expectedTransactions.Add(ExpectedSwiftTransaction.CreateExpected(new DateTime(2015, 1, 26), DebitCredit.Debit,
                                                                             "R", "GBP", 25.31M, "NTRF", "ITM1234567890123", "yyyyyyyyyyyyyyyyy\r\nAMZN.COM/BILL\r\non 23/01/2015", "Visa"));

            expectedTransactions.Add(ExpectedSwiftTransaction.CreateExpected(new DateTime(2015, 1, 26), DebitCredit.Credit,
                                                                             "R", "GBP", 18790M, "NTRF", "PON1234567890123", "yyyyyyyyyyyyyyyyy", "Inward Payment", "ABC12345678HRSXS"));

            var messageList =
                GetSample(StandardBankFormat, "Raptorious.SharpMt940Lib.Tests.Samples.StandardBank_few_transactions_GB.txt", CultureInfo.GetCultureInfo("en-GB")).ToList();

            var message = messageList[0];

            ExpectedSwiftMessage.AssertCustomerStatementTransactions(message, expectedTransactions);
        }