Exemple #1
0
 public void DeleteEmployee()
 {
     int empId = 6;
     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);
 }
Exemple #2
0
 public void ChangeHourlyTransaction()
 {
     int empId = 11;
     AddCommissionedEmployee t = new AddCommissionedEmployee(empId, "Lance", "Home", 2500, 3.2);
     t.Execute();
     ChangeHourlyTransaction cht = new ChangeHourlyTransaction(empId, 27.52);
     cht.Execute();
     Employee e = PayrollDatabase.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);
 }
Exemple #3
0
 public void TestAddCommissionedEmployee()
 {
     int empId = 5;
     AddCommissionedEmployee t = new AddCommissionedEmployee(empId, "Bob", "Home", 1000.00, 70.00);
     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.00, sc.Salary, .001);
     Assert.AreEqual(70.00, sc.CommissionRate, .001);
     PaymentSchedule ps = e.Schedule;
     Assert.IsTrue(ps is BiweeklySchedule);
     PaymentMethod pm = e.Method;
     Assert.IsTrue(pm is HoldMethod);
 }