当前位置: 首页>>代码示例>>C#>>正文


C# Bank.addCustomer方法代码示例

本文整理汇总了C#中Bank.addCustomer方法的典型用法代码示例。如果您正苦于以下问题:C# Bank.addCustomer方法的具体用法?C# Bank.addCustomer怎么用?C# Bank.addCustomer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bank的用法示例。


在下文中一共展示了Bank.addCustomer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestFirstCustomerMustBeJohn

 public void TestFirstCustomerMustBeJohn()
 {
     Bank bank = new Bank();
     Customer john = new Customer("John");
     bank.addCustomer(john);
     bank.addCustomer(new Customer("Henry"));
     string firstCustomerName = bank.getFirstCustomer();
     Assert.AreEqual("John",firstCustomerName);
 }
开发者ID:ashalabad,项目名称:abc-bank-c-sharp,代码行数:9,代码来源:BankTest.cs

示例2: customerSummaryOneAccount

        public void customerSummaryOneAccount()
        {
            Bank bank = new Bank();
            Customer john = new Customer("John");
            john.openAccount(new Account(Account.CHECKING));
            bank.addCustomer(john);

            Assert.AreEqual("Customer Summary\n - John (1 account)", bank.customerSummary());
        }
开发者ID:svishnevetsky,项目名称:abc-bank-c-sharp,代码行数:9,代码来源:BankTest.cs

示例3: customerSummary

        public void customerSummary()
        {
            Bank bank = new Bank();
            Customer john = new Customer("John");
            john.OpenAccount(new CheckingAccount());
            bank.addCustomer(john);

            Assert.AreEqual("Customer Summary\n - John (1 account)", bank.customerSummary());
        }
开发者ID:rajansindkar,项目名称:abc-bank-c-sharp,代码行数:9,代码来源:BankTest.cs

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例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: 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

示例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.0);

            Assert.AreEqual(0.1, bank.totalInterestPaid(), DOUBLE_DELTA);
        }
开发者ID:rajansindkar,项目名称:abc-bank-c-sharp,代码行数:11,代码来源:BankTest.cs

示例11: TestRenderCustomerSummary

        public void TestRenderCustomerSummary()
        {
            TextBankRenderer renderer=new TextBankRenderer();
            Bank bank = new Bank();
            Customer john = new Customer("John");
            IAccountFactory accountFactory = new AccountFactory(DateProvider.getInstance());
            john.openAccount(accountFactory.CreateAccount(AccountType.CHECKING));
            bank.addCustomer(john);

            Assert.AreEqual("Customer Summary\n - John (1 account)", renderer.Render(bank));
        }
开发者ID:ashalabad,项目名称:abc-bank-c-sharp,代码行数:11,代码来源:TextRendererTest.cs

示例12: 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

示例13: 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

示例14: TestTotalInterestPaidOnMixedAccountsSingleCustomer

 public void TestTotalInterestPaidOnMixedAccountsSingleCustomer()
 {
     Bank bank = new Bank();
     Account saving, maxiSaving, checking;
     Customer bill=new Customer("Bill")
         .openAccount(checking = accountFactory.CreateAccount(AccountType.CHECKING))
         .openAccount(maxiSaving = accountFactory.CreateAccount(AccountType.MAXI_SAVINGS))
         .openAccount(saving = accountFactory.CreateAccount(AccountType.SAVINGS));            
     bank.addCustomer(bill);
     saving.deposit(3000);
     checking.deposit(1000);
     maxiSaving.deposit(4000);
     double billInterest = bill.totalInterestEarned();
     Assert.AreEqual(billInterest,bank.totalInterestPaid());
 }
开发者ID:ashalabad,项目名称:abc-bank-c-sharp,代码行数:15,代码来源:BankTest.cs

示例15: transfer

 public void transfer()
 {
     Bank bank = new Bank();
     Account savingsAccount = new Account(Account.SAVINGS);
     Account checkingAccount = new Account(Account.CHECKING);
     Customer john = new Customer("John").openAccount(savingsAccount).openAccount(checkingAccount);
     bank.addCustomer(john);
     savingsAccount.deposit(1500.00, false);
     checkingAccount.deposit(200.00, false);
     john.transfer(savingsAccount, checkingAccount, 300);
     Assert.AreEqual(500, checkingAccount.sumTransactions(), DOUBLE_DELTA);
     Assert.AreEqual(1200, savingsAccount.sumTransactions(), DOUBLE_DELTA);
 }
开发者ID:svishnevetsky,项目名称:abc-bank-c-sharp,代码行数:13,代码来源:BankTest.cs


注:本文中的Bank.addCustomer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。