public void TestChangeSalaryTransaction() { int empId = 4; AddCommissionedEmployee t = new AddCommissionedEmployee( empId, "Lance", "Home", 2500, 3.2, database); t.Execute(); ChangeSalariedTransaction cst = new ChangeSalariedTransaction(empId, 3000.00, database); cst.Execute(); Employee e = database.GetEmployee(empId); Assert.IsNotNull(e); PaymentClassification pc = e.Classification; Assert.IsNotNull(pc); Assert.IsTrue(pc is SalariedClassification); SalariedClassification sc = pc as SalariedClassification; Assert.AreEqual(3000.00, sc.Salary, .001); PaymentSchedule ps = e.Schedule; Assert.IsTrue(ps is MonthlySchedule); }
private void button1_Click(object sender, EventArgs e) { int id = int.Parse(textid.Text); double salary = double.Parse(textsalary.Text); PayrollDatabase pd = new sytpayrolldatabase(); ChangeSalariedTransaction emp = new ChangeSalariedTransaction(id, salary, pd); emp.Execute(); }