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); }
private void ValidateHourlyPaycheck(PaydayTransaction pt, int empid, DateTime payDate, double pay) { Paycheck pc = pt.GetPaycheck(empid); Assert.IsNotNull(pc); Assert.AreEqual(payDate, pc.PayDate); Assert.AreEqual(pay, pc.GrossPay); Assert.AreEqual("Hold", pc.GetField("Disposition")); Assert.AreEqual(0.0, pc.Deductions, .001); Assert.AreEqual(pay, pc.NetPay, .001); }
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); }
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); }
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); }