예제 #1
0
        public void CreateBankAccount_ExceedCredit()
        {
            // Arrange/Act
            BankAccount ba1 = new BankAccount(bc1);

            ba1.Credit(100);
            ba1.Credit(Decimal.MaxValue);
        }
예제 #2
0
        public void CreateBankAccount_DebitExceedBalance()
        {
            // Arrange/Act
            BankAccount ba1 = new BankAccount(bc1);
            ba1.Credit(1000);

            ba1.Debit(9000);
        }
예제 #3
0
파일: Bank.cs 프로젝트: overxianz/fbm
        public BankAccount AddAccount(params BankClient[] clientList)
        {
            BankAccount newAccount = new BankAccount(clientList);

            this.BankAccountList.Add(newAccount);

            return newAccount;
        }
예제 #4
0
        public void CreateBankAccount_Credit()
        {
            // Arrange/Act
            BankAccount ba1 = new BankAccount(bc1);

            ba1.Credit(100);

            Assert.AreEqual(100, ba1.Balance);
        }
예제 #5
0
파일: Bank.cs 프로젝트: overxianz/fbm
        public BankAccount AddAccount(BankClient client)
        {
            // TODO: We should have some form of a logical check to make sure that the NationalId is unique.

            BankAccount newAccount = new BankAccount(client);

            this.BankAccountList.Add(newAccount);

            return newAccount;
        }
예제 #6
0
        public void CreateBankAccount_List()
        {
            // Arrange/Act
            BankAccount ba3 = new BankAccount(bcList);

            // Assert
            Assert.AreEqual(0, ba3.Balance, "Balance is not zero");
            Assert.AreEqual(5, ba3.OwnerList.Count, "Count is not 5");
            Assert.AreEqual("801-89-7744", ba3.OwnerList[0].NationalId);
            Assert.AreEqual("835-87-7880", ba3.OwnerList[1].NationalId);
            Assert.AreEqual("855-33-4267", ba3.OwnerList[2].NationalId);
            Assert.AreEqual("132-33-1337", ba3.OwnerList[3].NationalId);
            Assert.AreEqual("903-81-8769", ba3.OwnerList[4].NationalId);
        }
예제 #7
0
        public void CreateBankAccount_Params()
        {
            // Arrange/Act
            BankAccount ba2 = new BankAccount(bc1, bc2, bc3);

            // Assert
            Assert.AreEqual(0, ba2.Balance);
            Assert.AreEqual(3, ba2.OwnerList.Count);
            Assert.AreEqual("801-89-7744", ba2.OwnerList[0].NationalId);
            Assert.AreEqual("835-87-7880", ba2.OwnerList[1].NationalId);
            Assert.AreEqual("855-33-4267", ba2.OwnerList[2].NationalId);
        }
예제 #8
0
        public void CreateBankAccount_Single()
        {
            // Arrange/Act
            BankAccount ba1 = new BankAccount(bc1);

            // Assert
            Assert.AreEqual(0, ba1.Balance);
            Assert.AreEqual(1, ba1.OwnerList.Count);
            Assert.AreEqual("801-89-7744", ba1.OwnerList[0].NationalId);
        }