public void DeleteEmployee() { int empId = 4; AddCommissionedEmployee t = new AddCommissionedEmployee(empId, "Bill", "Home", 2500, 3.2); t.Execute(); Employee e = PayrollDatabase.GetEmployee(empId); Assert.IsNotNull(e); DeleteEmployeeTransaction dt = new DeleteEmployeeTransaction(empId); dt.Execute(); e = PayrollDatabase.GetEmployee(empId); Assert.IsNull(e); }
public void TestAddCommissionedEmployee() { int empId = 1; AddCommissionedEmployee t = new AddCommissionedEmployee(empId, "Bob", "Home", 1000.00, 0.50); t.Execute(); Employee e = PayrollDatabase.GetEmployee(empId); Assert.AreEqual("Bob", e.Name); PaymentClassification pc = e.Classification; Assert.IsTrue(pc is CommissionedClassification); CommissionedClassification sc = pc as CommissionedClassification; Assert.AreEqual(1000, sc.Salary, .001); Assert.AreEqual(0.50, sc.CommissionRate, .001); PaymentSchedule ps = e.Schedule; Assert.IsTrue(ps is BiweeklySchedule); PaymentMethod pm = e.Method; Assert.IsTrue(pm is HoldMethod); }