本文整理汇总了C#中Account.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Account.ToString方法的具体用法?C# Account.ToString怎么用?C# Account.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Account
的用法示例。
在下文中一共展示了Account.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
Account acct = new Account("1", 100);
Console.WriteLine(acct.ToString());
acct.withdraw(10);
Console.WriteLine(acct.ToString());
acct.deposit(23);
Console.WriteLine(acct.ToString());
CheckingAccount cacct = new CheckingAccount("2", 1000);
cacct.withdraw(1500);
Console.WriteLine(cacct.ToString());
Console.ReadKey();
}
示例2: writeAccountToFile
public void writeAccountToFile(Account account)
{
StreamWriter writer = new StreamWriter("attack_result.txt", true, Encoding.GetEncoding("ISO-8859-2"));
writer.WriteLine(DateTime.Now + ";" + account.ToString());
writer.Close();
}
示例3: ToString_method_returns_name
public void ToString_method_returns_name()
{
var account = new Account(1, "Barclays ISA", AccountType.Receivable);
Assert.AreEqual(account.Name, account.ToString());
}
示例4: AssertAccount
private void AssertAccount(Account walletPool, string operations)
{
Assert.Equal(operations, walletPool.ToString().Replace("\r\n", ""));
}