public void ValidateTransactionRecords()
        {
            // Arrange
            var nuban   = 1111111110;
            var note    = "short note";
            var account = new Account(id, accountType, nuban, owner, amount, note);

            BankData.Accounts.Add(account);

            var customer = new Customer(id, owner, email, nuban);

            BankData.Customers.Add(customer);

            var acctType       = "s";
            var initialDeposit = "1000";

            BankAccount.AddAccount(account, acctType.ToLower(), Convert.ToDecimal(initialDeposit));

            Account firstAccount  = BankData.Accounts[0];
            Account secondAccount = BankData.Accounts[1];

            // Act
            firstAccount.MakeTransferToSelf(secondAccount.AccountNumber, 300);
            var actual = firstAccount.allTransactions.Count;

            //Assert
            Assert.AreEqual(2, actual);
        }
        public void ReturnTheRightNumberOfAccountsForACustomer_WithMoreThanOneAccount()
        {
            // Arrange
            var nuban   = 1111111110;
            var note    = "short note";
            var account = new Account(id, accountType, nuban, owner, amount, note);

            BankData.Accounts.Add(account);
            var customer = new Customer(id, owner, email, nuban);

            BankData.Customers.Add(customer);

            var acctType       = "s";
            var initialDeposit = "1000";

            BankAccount.AddAccount(account, acctType.ToLower(), Convert.ToDecimal(initialDeposit));

            var acctType2       = "s";
            var initialDeposit2 = "1000";

            BankAccount.AddAccount(account, acctType2.ToLower(), Convert.ToDecimal(initialDeposit2));
            // Act
            var actual = BankData.Customers[0].Numbers.Count;

            // Assert
            Assert.AreEqual(3, actual);;
        }
        public void AccurateBalanceAfterTransferToAnotherPersonalAccount()
        {
            // Arrange
            var nuban   = 1111111110;
            var note    = "short note";
            var account = new Account(id, accountType, nuban, owner, amount, note);

            BankData.Accounts.Add(account);
            var customer = new Customer(id, owner, email, nuban);

            BankData.Customers.Add(customer);
            var acctType       = "s";
            var initialDeposit = "1000";

            BankAccount.AddAccount(account, acctType.ToLower(), Convert.ToDecimal(initialDeposit));
            Account firstAccount  = BankData.Accounts[0];
            Account secondAccount = BankData.Accounts[1];

            // Act
            firstAccount.MakeTransferToSelf(secondAccount.AccountNumber, 300);
            var actual = firstAccount.Balance;

            // Assert
            Assert.AreEqual(700, actual);
        }
Exemple #4
0
        private void btnInsertCustomer_Click(object sender, EventArgs e)
        {
            string[] accountTab = new string[3];
            accountTab[0] = comboBox1.SelectedValue.ToString();
            accountTab[1] = textBox2.Text;
            accountTab[2] = textBox3.Text;

            BankAccount account = new BankAccount();

            account.SetBankAccount(accountTab);

            labInsertInfo.Text = account.AddAccount();

            RefreshDataGridView();
        }