Beispiel #1
0
 public void PayingSingleHourlyEmployeeNoTimeCards()
 {
     int empid = 16;
     AddHourlyEmployee t = new AddHourlyEmployee(empid, "Bill", "Address", 15.25);
     t.Execute();
     DateTime payDate = new DateTime(2015, 11, 27);
     PaydayTransaction pt = new PaydayTransaction(payDate);
     pt.Execute();
     Paycheck pc = pt.GetPaycheck(empid);
     Assert.IsNotNull(pc);
     Assert.AreEqual(payDate, pc.PayDate);
     Assert.AreEqual(0.0, pc.GrossPay);
     Assert.AreEqual("Hold", pc.GetField("Disposition"));
     Assert.AreEqual(0.0, pc.Deductions, .001);
     Assert.AreEqual(0.0, pc.NetPay, .001);
 }
Beispiel #2
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);
 }
Beispiel #3
0
 public void PaySingleSalariedEmployeeOnWrongDate()
 {
     int empid = 15;
     AddSalariedEmployee t = new AddSalariedEmployee(empid, "Bob", "Home", 1000.00);
     t.Execute();
     DateTime payDate = new DateTime(2015, 12, 16);
     PaydayTransaction pt = new PaydayTransaction(payDate);
     pt.Execute();
     Paycheck pc = pt.GetPaycheck(empid);
     Assert.IsNull(pc);
 }
Beispiel #4
0
 public void PaySingleSalariedEmployee()
 {
     int empid = 14;
     AddSalariedEmployee t = new AddSalariedEmployee(empid, "Bob", "Home", 1000.00);
     t.Execute();
     DateTime payDate = new DateTime(2001, 11, 30);
     PaydayTransaction pt = new PaydayTransaction(payDate);
     pt.Execute();
     Paycheck pc = pt.GetPaycheck(empid);
     Assert.IsNotNull(pc);
     Assert.AreEqual(payDate, pc.PayDate);
     Assert.AreEqual(1000.00, pc.GrossPay, .001);
     Assert.AreEqual("Hold", pc.GetField("Disposition"));
     Assert.AreEqual(0.0, pc.Deductions, .001);
     Assert.AreEqual(1000.00, pc.NetPay, .001);
 }
Beispiel #5
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);
 }
Beispiel #6
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);
 }