public void TestChangeHourlyTransaction() { int empId = 3; AddCommissionedEmployee t = new AddCommissionedEmployee( empId, "Lance", "Home", 2500, 3.2, database); t.Execute(); ChangeHourlyTransaction cht = new ChangeHourlyTransaction(empId, 27.52, database); cht.Execute(); Employee e = database.GetEmployee(empId); Assert.IsNotNull(e); PaymentClassification pc = e.Classification; Assert.IsNotNull(pc); Assert.IsTrue(pc is HourlyClassification); HourlyClassification hc = pc as HourlyClassification; Assert.AreEqual(27.52, hc.HourlyRate, .001); PaymentSchedule ps = e.Schedule; Assert.IsTrue(ps is WeeklySchedule); }
private void button1_Click(object sender, EventArgs e) { int id = int.Parse(textid.Text); double rate = double.Parse(textrate.Text); PayrollDatabase pd = new sytpayrolldatabase(); ChangeHourlyTransaction emp = new ChangeHourlyTransaction(id, rate, pd); emp.Execute(); }