Example #1
0
        public async Task PropertiesAfterMakeInternalTransfer(double d1, double it1)
        {
            //Arrange
            decimal   depositAmount          = (decimal)d1;
            decimal   internalTransferAmount = (decimal)it1;
            WalletDTO wallet = await ArrangeWallet();

            WalletDTO secondWallet = await ArrangeSecondWallet();

            await _paymentTransactionService.MakeDepositPaymentTransaction(wallet.UniqueMasterCitizenNumber,
                                                                           wallet.Password,
                                                                           depositAmount);

            //Act
            InternalTransferPaymentTransactionsDTO paymentTransactions = await _paymentTransactionService
                                                                         .MakeInternalTransferPaymentTransaction(wallet.UniqueMasterCitizenNumber,
                                                                                                                 wallet.Password,
                                                                                                                 secondWallet.UniqueMasterCitizenNumber,
                                                                                                                 internalTransferAmount);

            //Assert
            Assert.AreEqual(paymentTransactions.Deposit.Amount, internalTransferAmount);
            Assert.AreEqual(paymentTransactions.Withdrawal.Amount, internalTransferAmount);
            Assert.AreEqual(paymentTransactions.Fee.Amount, 0);
            WalletDTO assertWallet = await _walletService.GetWalletByUniqueMasterCitizenNumberAndPassword(wallet.UniqueMasterCitizenNumber, wallet.Password);

            Assert.AreEqual(assertWallet.CurrentAmount, depositAmount - internalTransferAmount);
            WalletDTO assertSecondWallet = await _walletService.GetWalletByUniqueMasterCitizenNumberAndPassword(secondWallet.UniqueMasterCitizenNumber, secondWallet.Password);

            Assert.AreEqual(assertSecondWallet.CurrentAmount, internalTransferAmount);
            Assert.AreEqual(assertWallet.PaymentTransactions.Count(), 2);
            Assert.AreEqual(assertSecondWallet.PaymentTransactions.Count(), 1);
        }
Example #2
0
        public async Task NumberOfDaysWithoutFeeAfterMakeInternalTransfer(double d)
        {
            //Arrange
            decimal   amount = (decimal)d;
            WalletDTO wallet = await ArrangeWallet();

            WalletDTO secondWallet = await ArrangeSecondWallet();

            await _paymentTransactionService.MakeDepositPaymentTransaction(wallet.UniqueMasterCitizenNumber, wallet.Password, amount);

            //Act
            InternalTransferPaymentTransactionsDTO paymentTransactions = await _paymentTransactionService.MakeInternalTransferPaymentTransaction(wallet.UniqueMasterCitizenNumber, wallet.Password, secondWallet.UniqueMasterCitizenNumber, amount);

            //Assert
            Assert.AreEqual(paymentTransactions.Fee.Amount, 0);
            WalletDTO assertWallet = await _walletService.GetWalletByUniqueMasterCitizenNumberAndPassword(wallet.UniqueMasterCitizenNumber, wallet.Password);

            Assert.AreEqual(assertWallet.PaymentTransactions.Count(), 2);
        }
Example #3
0
        public async Task FirstInternalTransferInMonthAfterMakeInternalTransfer(double d)
        {
            //Arrange
            DateTime now         = DateTime.Now;
            DateTime monthBefore = now.AddMonths(-1);

            decimal   amount = (decimal)d;
            WalletDTO wallet = await ArrangeWalletOnSpecificDateWithAmount(monthBefore, amount);

            WalletDTO secondWallet = await ArrangeSecondWallet();

            //Act
            InternalTransferPaymentTransactionsDTO paymentTransactions = await _paymentTransactionService.MakeInternalTransferPaymentTransaction(wallet.UniqueMasterCitizenNumber, wallet.Password, secondWallet.UniqueMasterCitizenNumber, amount);

            //Assert
            Assert.AreEqual(paymentTransactions.Fee.Amount, 0);
            WalletDTO assertWallet = await _walletService.GetWalletByUniqueMasterCitizenNumberAndPassword(wallet.UniqueMasterCitizenNumber, wallet.Password);

            Assert.AreEqual(assertWallet.PaymentTransactions.Count(), 1);
        }