Beispiel #1
0
 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);
 }
Beispiel #2
0
 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);
 }