private void button1_Click(object sender, EventArgs e) { int id = int.Parse(textid.Text); string name = textname.Text; PayrollDatabase pd = new sytpayrolldatabase(); ChangeNameTransaction emp = new ChangeNameTransaction(id, name, pd); emp.Execute(); }
public void TestChangeNameTransaction() { int empId = 2; AddHourlyEmployee t = new AddHourlyEmployee(empId, "Bill", "Home", 15.25, database); t.Execute(); ChangeNameTransaction cnt = new ChangeNameTransaction(empId, "Bob", database); cnt.Execute(); Employee e = database.GetEmployee(empId); Assert.IsNotNull(e); Assert.AreEqual("Bob", e.Name); }