public void InitializeBank() { //inicializar el array Accounts = new Account[100]; try { int counter = 0; //leer los datos desde el archivo //en este caso se toma el archivo completo y se guarda en un array string[] lines = File.ReadAllLines("bank.txt"); //se recorre el array para obtener los datos foreach(string line in lines){ string[] temp_account = line.Split(' '); Account t_account = new Account(); t_account.AccountNumber = Convert.ToInt32(temp_account[0]); t_account.AccountPass = Convert.ToInt32(temp_account[1]); t_account.AccountBalance = Convert.ToInt32(temp_account[2]); t_account.AccountType = temp_account[3]; Accounts[counter] = t_account; counter++; } } catch (Exception e) { Console.WriteLine("The file could not be read:"); Console.WriteLine(e.Message); } }
public void TransferFunds() { Account source = new Account(); source.Deposit(200); Account destination = new Account(); destination.Deposit(150); source.TransferFunds(destination, 100); Assert.AreEqual(250, destination.Balance); Assert.AreEqual(100, source.Balance); }
public void TransferFunds(Account destination, decimal amount) { }
private void btnTemp_Click(object sender, EventArgs e) { Account a1; a1 = new Account(); a = a1; }
private void btnDestroy_Click(object sender, EventArgs e) { a = null; }
private void btnCreate_Click(object sender, EventArgs e) { a = new Account(); }