Пример #1
0
 public void TestChangeHourlyTransaction()
 {
     int empId = 8;
     AddComissionedEmployee t = new AddComissionedEmployee(empId, "Bill", "home", 100, 400);
     t.Execute();
     ChangeHourlyTransaction cht = new ChangeHourlyTransaction(empId, 200);
     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(200, hc.Rate, .001);
     PaymentSchedule ps = e.Schedule;
     Assert.IsTrue(ps is HourlySchedule);
 }
Пример #2
0
 public void TestAddCommissionedEmployee()
 {
     int empId = 3;
     AddComissionedEmployee t = new AddComissionedEmployee(empId, "Bob", "Home", 100.00, 1000.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(100.00, sc.CRate, .001);
     PaymentSchedule ps = e.Schedule;
     Assert.IsTrue(ps is BiweeklySchedule);
     PaymentMethod pm = e.Method;
     Assert.IsTrue(pm is HoldMethod);
 }