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


C# Account.Deposit方法代码示例

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


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

示例1: Main

        public static void Main()
        {
            var account = new Account("Jim Johnson");

            account.Deposit(500.0);
            account.Deposit(300.0);
            account.Deposit(550.0);
            account.PayInterest();
            account.Withdraw(1000.00);
            account.Withdraw(1100.00);
        }
开发者ID:Alex223124,项目名称:High-Quality-Code,代码行数:11,代码来源:Program.cs

示例2: TestDeposit

	public void TestDeposit()
	{
		Account acc = new Account();
		acc.Deposit(200.00F);
		float balance = acc.Balance;
		Assert.AreEqual(balance, 200F);
	}
开发者ID:Alex223124,项目名称:High-Quality-Code,代码行数:7,代码来源:TestAccount.cs

示例3: TransferFunds

 public static void TransferFunds(Account sourceAccount,
                                  Account destinationAccount,
                                  float amount)
 {
     sourceAccount.Withdraw(amount);
     destinationAccount.Deposit(amount);
 }
开发者ID:paulrayner,项目名称:console_app,代码行数:7,代码来源:MoneyMover.cs

示例4: TestTransferFundsToNullAccount

	public void TestTransferFundsToNullAccount()
	{
		Account source = new Account();
		source.Deposit(200.00F);
		Account dest = null;
		source.TransferFunds(dest, 100.00F);
	}
开发者ID:Alex223124,项目名称:High-Quality-Code,代码行数:7,代码来源:TestAccount.cs

示例5: TestDepositNegative

	public void TestDepositNegative()
	{
		Account acc = new Account();
		acc.Deposit(-150.30F);
		float balance = acc.Balance;
		Assert.AreEqual(balance, -150.30F);
	}
开发者ID:Alex223124,项目名称:High-Quality-Code,代码行数:7,代码来源:TestAccount.cs

示例6: TestDeposit

        public void TestDeposit(double sum)
        {
            var account = new Account();
            account.Deposit(300.0);

            Assert.AreEqual(300.0, account.Balance);
        }
开发者ID:AngataHristov,项目名称:High-Quality-Code,代码行数:7,代码来源:AccountTests.cs

示例7: TestDeposit

 public void TestDeposit()
 {
     Account acc = new Account();
     acc.Deposit(200.00M);
     decimal balance = acc.Balance;
     Assert.AreEqual(balance, 200.00M);
 }
开发者ID:premiera85,项目名称:Software-University,代码行数:7,代码来源:AccountTest.cs

示例8: TestDeposit

 public void TestDeposit()
 {
     var acc = new Account();
     acc.Deposit(200.00M);
     var balance = acc.Balance;
     Assert.AreEqual(balance, 200.00M);
 }
开发者ID:EBojilova,项目名称:CSharpHQC,代码行数:7,代码来源:AccountTest.cs

示例9: CreateAccount

        public static Account CreateAccount(double initialBalance)
        {
            var newAccount = new Account(++_runningId);
            newAccount.Deposit(initialBalance);

            return newAccount;
        }
开发者ID:vadim183,项目名称:CodeValueCollege,代码行数:7,代码来源:AccountFactory.cs

示例10: TestDepositNegative

 public void TestDepositNegative()
 {
     var acc = new Account();
     acc.Deposit(-150.30M);
     var balance = acc.Balance;
     Assert.AreEqual(balance, -150.30M);
 }
开发者ID:EBojilova,项目名称:CSharpHQC,代码行数:7,代码来源:AccountTest.cs

示例11: WithdrawalControllerTest

        public WithdrawalControllerTest()
        {
            var aEventLog = new EventLog();
            var aMockRepo = new Mock<IAccountRepository>();
            var aAccount = new Account(0, aEventLog);
            aAccount.Deposit(10);	// seed the account with a positive balance
            aMockRepo.Setup(aRepo => aRepo.GetAccount()).Returns(aAccount);

            /*********************************************************************************************
                build mock data for ControllerContext so that context-dependent properties can be tested
                (headers, routing, etc...)
            *********************************************************************************************/
            var config = new HttpConfiguration();
            var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/api/account");
            var route = config.Routes.MapHttpRoute("DefaultApi", "api/v{version}/{controller}/{id}");
            var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "controller", "Withdrawal" } });

            /*********************************************************************************************
                build the Controller (class under test) and initialize it with the ControllerContext
            *********************************************************************************************/
            _controller = new WithdrawalController(aMockRepo.Object)
            {
                ControllerContext = new HttpControllerContext(config, routeData, request),
                Request = request
            };
            _controller.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config;
        }
开发者ID:gblosser,项目名称:RefactoringIterations,代码行数:27,代码来源:WithdrawalControllerTest.cs

示例12: TestTransferFundsSameAccount

 public void TestTransferFundsSameAccount()
 {
     var source = new Account();
     source.Deposit(200.00F);
     var dest = source;
     source.TransferFunds(dest, 100.00F);
 }
开发者ID:EBojilova,项目名称:CSharpHQC,代码行数:7,代码来源:TestAccount.cs

示例13: TestTransferFundsFromNullAccount

 public void TestTransferFundsFromNullAccount()
 {
     Account source = null;
     var dest = new Account();
     dest.Deposit(200.00F);
     source.TransferFunds(dest, 100.00F);
 }
开发者ID:EBojilova,项目名称:CSharpHQC,代码行数:7,代码来源:TestAccount.cs

示例14: Deposit

 protected override Transaction Deposit(Account account, Transfer transfer, string code, string description)
 {
     var payment = (CardPayment) transfer;
     var depositTransaction = account.Deposit(code, description, Settings.Location, new Money(transfer.Currency, transfer.Amount), MoneyConverter);
     var paymentLink = new PaymentTransactionLink(depositTransaction, payment.Order);
     _paymentTransactionLinkRepository.Create(paymentLink);
     return depositTransaction;
 }
开发者ID:al-main,项目名称:vabank,代码行数:8,代码来源:CardPaymentProcessor.cs

示例15: Withdraw_NonEmptyAccount_ShouldPass

        public void Withdraw_NonEmptyAccount_ShouldPass()
        {
            var account = new Account();
            account.Deposit(3000.0);
            account.Withdraw(2000.0);

            Assert.AreEqual(1000.0, account.Balance);
        }
开发者ID:AngataHristov,项目名称:High-Quality-Code,代码行数:8,代码来源:AccountTests.cs


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