Exemple #1
0
 public void PayingSingleHourlyEmployeeOvertimeTimeCards()
 {
     int empid = 18;
     AddHourlyEmployee t = new AddHourlyEmployee(empid, "Bob", "Home", 15.25);
     t.Execute();
     DateTime payDate = new DateTime(2015, 11, 27);
     TimeCardTransaction tc = new TimeCardTransaction(payDate, 9.0, empid);
     tc.Execute();
     PaydayTransaction pt = new PaydayTransaction(payDate);
     pt.Execute();
     ValidateHourlyPaycheck(pt, empid, payDate, (8 + 1.5) * 15.25);
 }
Exemple #2
0
 public void PaySingleHourlyEmployeeOnWrongDate()
 {
     int empid = 19;
     AddHourlyEmployee t = new AddHourlyEmployee(empid, "Bill", "Home", 15.25);
     t.Execute();
     DateTime payDate = new DateTime(2015, 12, 3);
     TimeCardTransaction tc = new TimeCardTransaction(payDate, 9.0, empid);
     tc.Execute();
     PaydayTransaction pt = new PaydayTransaction(payDate);
     pt.Execute();
     Paycheck pc = pt.GetPaycheck(empid);
     Assert.IsNull(pc);
 }
Exemple #3
0
 public void TestTimeCardTransaction()
 {
     int empId = 5;
     AddHourlyEmployee t = new AddHourlyEmployee(empId, "Bill", "home", 2000);
     t.Execute();
     TimeCardTransaction tct = new TimeCardTransaction(new DateTime(2015, 10, 31), 8.0, empId);
     tct.Execute();
     Employee e = PayrollDatabase.GetEmployee(empId);
     Assert.IsNotNull(e);
     PaymentClassification pc = e.Classification;
     Assert.IsTrue(pc is HourlyClassification);
     HourlyClassification hc = pc as HourlyClassification;
     TimeCard tc = hc.GetTimeCard(new DateTime(2015,10,31));
     Assert.IsNotNull(tc);
     Assert.AreEqual(8.0, tc.Hours);
 }
Exemple #4
0
 public void PayingSingleHourlyEmployeeTwoTimeCards()
 {
     int empId = 20;
     AddHourlyEmployee t = new AddHourlyEmployee(empId, "Bill", "Home", 15.25);
     t.Execute();
     DateTime payDate = new DateTime(2015, 12, 4);
     TimeCardTransaction tc = new TimeCardTransaction(payDate, 2.0, empId);
     tc.Execute();
     TimeCardTransaction tc2 = new TimeCardTransaction(payDate.AddDays(-1), 5.0, empId);
     tc2.Execute();
     PaydayTransaction pt = new PaydayTransaction(payDate);
     pt.Execute();
     ValidateHourlyPaycheck(pt, empId, payDate, 7 * 15.25);
 }