public void ShowTotal_Test30_Outputis30() { int runningTotal = 30; User.RunningCost = 30; string expected = "The current running total for " + User.UserName + " is: " + runningTotal; string actual = User.ShowTotal(); Assert.AreEqual(expected, actual); }
private void UserAccount_Load(object sender, EventArgs e) { CurrentUser(); ReadFromFile(); //Find the current user username = CurrentUser(); user = users.FindItem(username); lblUser.Text = user.ToString() + ", " + user.Name; lblRunTotal.Text = user.ShowTotal(); }
private void btnPay_Click(object sender, EventArgs e) { MessageBox.Show(user.Pay()); // open file for output outFile = new FileStream(FILENAME, FileMode.Append, FileAccess.Write); // output object to file via serialization bFormatter.Serialize(outFile, user); // close file outFile.Close(); //clear label with old total lblRunTotal.Text = user.ShowTotal(); }