当前位置: 首页>>代码示例>>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;未经允许,请勿转载。