當前位置: 首頁>>代碼示例>>C#>>正文


C# Bank.totalInterestPaid方法代碼示例

本文整理匯總了C#中Bank.totalInterestPaid方法的典型用法代碼示例。如果您正苦於以下問題:C# Bank.totalInterestPaid方法的具體用法?C# Bank.totalInterestPaid怎麽用?C# Bank.totalInterestPaid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Bank的用法示例。


在下文中一共展示了Bank.totalInterestPaid方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: MaxiSavingsAccount

        public void MaxiSavingsAccount()
        {
            Bank bank = new Bank();
            MaxiSavingsAccount maxiSavingsAccount = new MaxiSavingsAccount();
            bank.AddCustomer(new Customer("Bill").OpenAccount(maxiSavingsAccount));

            maxiSavingsAccount.Deposit(3000.0m);
            Assert.AreEqual(170, bank.totalInterestPaid());

            // change the interest strategy
            maxiSavingsAccount.SetInterestStrategy(new MaxiSavingsAccountFivePercentInterestStrategy());
            Assert.AreEqual(150, bank.totalInterestPaid());
        }
開發者ID:zmosk,項目名稱:ABC-Bank,代碼行數:13,代碼來源:BankTest.cs

示例2: savings_account

        public void savings_account()
        {
            Bank bank = new Bank();
            SavingsAccount savingAccount = new SavingsAccount();
            bank.addCustomer(new Customer("Bill").OpenAccount(savingAccount));

            savingAccount.deposit(1500.0);

            Assert.AreEqual(2.0, bank.totalInterestPaid(), DOUBLE_DELTA);
        }
開發者ID:rajansindkar,項目名稱:abc-bank-c-sharp,代碼行數:10,代碼來源:BankTest.cs

示例3: maxi_savings_account

        public void maxi_savings_account()
        {
            Bank bank = new Bank();
            MaxSavingsAccount maxsavingAccount = new MaxSavingsAccount();
            bank.addCustomer(new Customer("Bill").OpenAccount(maxsavingAccount));

            maxsavingAccount.deposit(3000.0);

            Assert.AreEqual(170.0, bank.totalInterestPaid(), DOUBLE_DELTA);
        }
開發者ID:rajansindkar,項目名稱:abc-bank-c-sharp,代碼行數:10,代碼來源:BankTest.cs

示例4: savings_account

        public void savings_account()
        {
            Bank bank = new Bank();
            Account checkingAccount = new Account(AccountType.Savings);
            bank.addCustomer(new Customer("Bill").openAccount(checkingAccount));

            checkingAccount.deposit(1500.0);

            Assert.AreEqual(2.0, bank.totalInterestPaid(), DOUBLE_DELTA);
        }
開發者ID:hopsusa,項目名稱:abc-bank-c-sharp,代碼行數:10,代碼來源:BankTest.cs

示例5: maxi_savings_account

        public void maxi_savings_account()
        {
            Bank bank = new Bank();
            Account checkingAccount = new Account(Account.MAXI_SAVINGS);
            bank.addCustomer(new Customer("Bill").openAccount(checkingAccount));

            checkingAccount.deposit(3000.0);

            Assert.AreEqual(170.0, bank.totalInterestPaid(), DOUBLE_DELTA);
        }
開發者ID:juliasunnyc,項目名稱:abc-bank-c-sharp,代碼行數:10,代碼來源:BankTest.cs

示例6: maxi_savings1500_account

        public void maxi_savings1500_account()
        {
            Bank bank = new Bank();
            Account maxiSavingsAccount = new Account(Account.MAXI_SAVINGS);
            bank.addCustomer(new Customer("Bill").openAccount(maxiSavingsAccount));

            maxiSavingsAccount.deposit(1500.00, false);

            Assert.AreEqual(45.00, bank.totalInterestPaid(), DOUBLE_DELTA);
        }
開發者ID:svishnevetsky,項目名稱:abc-bank-c-sharp,代碼行數:10,代碼來源:BankTest.cs

示例7: SavingsAccount

        public void SavingsAccount()
        {
            Bank bank = new Bank();
            SavingsAccount savingsAccount = new SavingsAccount();
            bank.AddCustomer(new Customer("Bill").OpenAccount(savingsAccount));

            savingsAccount.Deposit(1500.0m);

            Assert.AreEqual(2.0m, bank.totalInterestPaid());
        }
開發者ID:zmosk,項目名稱:ABC-Bank,代碼行數:10,代碼來源:BankTest.cs

示例8: savings_account

        public void savings_account()
        {
            Bank bank = new Bank();
            Account savingsAccount = accountFactory.CreateAccount(AccountType.SAVINGS);
            bank.addCustomer(new Customer("Bill").openAccount(savingsAccount));

            savingsAccount.deposit(1500.0);

            Assert.AreEqual(2.0, bank.totalInterestPaid(), DOUBLE_DELTA);
        }
開發者ID:ashalabad,項目名稱:abc-bank-c-sharp,代碼行數:10,代碼來源:BankTest.cs

示例9: checkingAccount

        public void checkingAccount()
        {
            Bank bank = new Bank();
            CheckingAccount checkingAccount = new CheckingAccount();
            Customer bill = new Customer("Bill").OpenAccount(checkingAccount);
            bank.addCustomer(bill);

            checkingAccount.deposit(100.0);

            Assert.AreEqual(0.1, bank.totalInterestPaid(), DOUBLE_DELTA);
        }
開發者ID:rajansindkar,項目名稱:abc-bank-c-sharp,代碼行數:11,代碼來源:BankTest.cs

示例10: CheckingAccount

        public void CheckingAccount()
        {
            Bank bank = new Bank();
            CheckingAccount checkingAccount = new CheckingAccount();
            Customer bill = new Customer("Bill").OpenAccount(checkingAccount);
            bank.AddCustomer(bill);

            checkingAccount.Deposit(100.0m);

            Assert.AreEqual(0.1m, bank.totalInterestPaid());
        }
開發者ID:zmosk,項目名稱:ABC-Bank,代碼行數:11,代碼來源:BankTest.cs

示例11: checkingAccount

        public void checkingAccount()
        {
            Bank bank = new Bank();
            Account checkingAccount = accountFactory.CreateAccount(AccountType.CHECKING);
            Customer bill = new Customer("Bill").openAccount(checkingAccount);
            bank.addCustomer(bill);

            checkingAccount.deposit(100.0);

            Assert.AreEqual(0.1, bank.totalInterestPaid(), DOUBLE_DELTA);
        }
開發者ID:ashalabad,項目名稱:abc-bank-c-sharp,代碼行數:11,代碼來源:BankTest.cs

示例12: maxi_savings_account

 public void maxi_savings_account()
 {
     DateTime nowDate=new DateTime(1970,1,1);
     TestDateProvider provider = new TestDateProvider(() => nowDate);
     Bank bank = new Bank();
     Account maxiSavingsAccount = new AccountFactory(provider).CreateAccount(AccountType.MAXI_SAVINGS);
     bank.addCustomer(new Customer("Bill").openAccount(maxiSavingsAccount));
     maxiSavingsAccount.deposit(3000.0);
     //change current date to 1970/6/30
     nowDate = nowDate + new TimeSpan(180, 0, 0, 0);
     double expected = 3000.0d.DailyInterest(5.0, 180);
     Assert.AreEqual(expected, bank.totalInterestPaid(), DOUBLE_DELTA);
 }
開發者ID:ashalabad,項目名稱:abc-bank-c-sharp,代碼行數:13,代碼來源:BankTest.cs

示例13: total_interest_forBank

        public void total_interest_forBank()
        {
            Bank bank = new Bank();
            Account checkingAccount = new Account(Account.CHECKING);
            Customer bill = new Customer("Bill").openAccount(checkingAccount);
            bank.addCustomer(bill);
            checkingAccount.deposit(100.00, false);

            Account maxiSavingsAccount = new Account(Account.MAXI_SAVINGS);
            Customer sam = new Customer("Sam").openAccount(maxiSavingsAccount);
            bank.addCustomer(sam);
            maxiSavingsAccount.deposit(3000.0, false);

            Account savingsAccount = new Account(Account.SAVINGS);
            Customer john = new Customer("John").openAccount(savingsAccount);
            bank.addCustomer(john);
            savingsAccount.deposit(1500.00, false);
            //should be 0.1+170+2
            Assert.AreEqual(172.1, bank.totalInterestPaid(), DOUBLE_DELTA);
        }
開發者ID:svishnevetsky,項目名稱:abc-bank-c-sharp,代碼行數:20,代碼來源:BankTest.cs

示例14: savings500_account

        public void savings500_account()
        {
            Bank bank = new Bank();
            Account savingsAccount = new Account(Account.SAVINGS);
            bank.addCustomer(new Customer("Bill").openAccount(savingsAccount));

            savingsAccount.deposit(500.00, false);

            Assert.AreEqual(0.50, bank.totalInterestPaid(), DOUBLE_DELTA);
        }
開發者ID:svishnevetsky,項目名稱:abc-bank-c-sharp,代碼行數:10,代碼來源:BankTest.cs

示例15: TestTotalInterestPaidOnMixedAccountsMultipleCustomers

 public void TestTotalInterestPaidOnMixedAccountsMultipleCustomers()
 {
     Bank bank = new Bank();
     Account billSaving, billMaxiSaving, billChecking;
     Customer bill = new Customer("Bill")
         .openAccount(billChecking = accountFactory.CreateAccount(AccountType.CHECKING))
         .openAccount(billMaxiSaving = accountFactory.CreateAccount(AccountType.MAXI_SAVINGS))
         .openAccount(billSaving = accountFactory.CreateAccount(AccountType.SAVINGS));
     bank.addCustomer(bill);
     Account oscarSaving, oscarMaxiSaving, oscarChecking;
     Customer oscar = new Customer("Oscar")
         .openAccount(oscarChecking = accountFactory.CreateAccount(AccountType.CHECKING))
         .openAccount(oscarMaxiSaving = accountFactory.CreateAccount(AccountType.MAXI_SAVINGS))
         .openAccount(oscarSaving = accountFactory.CreateAccount(AccountType.SAVINGS));
     bank.addCustomer(oscar);
     billSaving.deposit(3000);
     billChecking.deposit(1000);
     billMaxiSaving.deposit(4000);
     double billInterest = bill.totalInterestEarned();
     oscarSaving.deposit(3000);
     oscarChecking.deposit(1000);
     oscarMaxiSaving.deposit(4000);
     double oscarInterest = oscar.totalInterestEarned();
     Assert.AreEqual(oscarInterest+billInterest,bank.totalInterestPaid());
 }
開發者ID:ashalabad,項目名稱:abc-bank-c-sharp,代碼行數:25,代碼來源:BankTest.cs


注:本文中的Bank.totalInterestPaid方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。