本文整理匯總了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", ""));
}