Esempio n. 1
0
        public void TestGetTransactionDetails_Failed()
        {
            var credentials = new Dictionary <string, string> {
                { "username", "YURIYK81" }, { "password", "2w3e4r5t" }
            };
            var calApi       = new Providers.Cards.Cal.CalApi(credentials);
            var transactions = calApi.GetTransactions("01981802", DateTime.Now.AddMonths(-1), DateTime.Now).ToList();

            var transactionId = transactions.First().Id.Substring(1);
            var numerator     = transactions.First().Numerator;

            var exception = Assert.Throws <Exception>(() => calApi.GetTransactionDetails(transactionId, numerator));

            calApi.Dispose();

            Assert.NotNull(exception);
        }
Esempio n. 2
0
        public void TestGetTransactions_Success()
        {
            var credentials = new Dictionary <string, string> {
                { "username", "YURIYK81" }, { "password", "2w3e4r5t" }
            };
            var calApi       = new Providers.Cards.Cal.CalApi(credentials);
            var transactions = calApi.GetTransactions("01981802", DateTime.Now.AddMonths(-1), DateTime.Now).ToList();

            calApi.Dispose();

            Assert.True(transactions.Any());
            foreach (var transaction in transactions)
            {
                Assert.NotEmpty(transaction.Id);
                Assert.NotEmpty(transaction.Currency);
                Assert.NotEmpty(transaction.CurrentPayment);
                Assert.NotEmpty(transaction.Date);
                Assert.NotEmpty(transaction.DebitDate);
                //Assert.NotEmpty(transaction.Notes);
                //Assert.NotEmpty(transaction.Comments);
            }
        }
Esempio n. 3
0
        public void TestGetTransactionDetails_Success()
        {
            var credentials = new Dictionary <string, string> {
                { "username", "YURIYK81" }, { "password", "2w3e4r5t" }
            };
            var calApi       = new Providers.Cards.Cal.CalApi(credentials);
            var transactions = calApi.GetTransactions("01981802", DateTime.Now.AddMonths(-1), DateTime.Now).ToList();

            foreach (var transaction in transactions)
            {
                var transactionId = transaction.Id;
                var numerator     = transaction.Numerator;
                var details       = calApi.GetTransactionDetails(transactionId, numerator);

                Assert.NotNull(details);
                Assert.NotNull(details.Data);
                Assert.NotNull(details.Data.MerchantDetails);
                //Assert.NotNull(details.Data.MerchantDetails.Address);
                //Assert.NotNull(details.Data.MerchantDetails.SectorName);
            }

            calApi.Dispose();
        }