public void TestHourlyUnionMemberServiceCharge() { const int empId = 26; var t = new AddHourlyEmployee(empId, "Bill", "Home", 15.24); t.Execute(); const int memberId = 7735; var cmt = new ChangeMemberTransaction(empId, memberId, 9.42); cmt.Execute(); var payDate = new DateTime(2020, 11, 6); var sct = new ServiceChargeTransaction(memberId, payDate, 19.42); sct.Execute(); var tct = new TimeCardTransaction(payDate, 8.0, empId); tct.Execute(); var pt = new PaydayTransaction(payDate); pt.Execute(); var pc = pt.GetPaycheck(empId); Assert.IsNotNull(pc); Assert.AreEqual(payDate, pc.PayPeriodEndDate); Assert.AreEqual(8 * 15.24, pc.GrossPay, 0.001); Assert.AreEqual("Hold", pc.GetField("Disposition")); Assert.AreEqual(9.42 + 19.42, pc.Deductions, 0.001); Assert.AreEqual(8 * 15.24 - (9.42 + 19.42), pc.NetPay, 0.001); }
public void TestAddServiceCharge() { const int empId = 7; var t = new AddHourlyEmployee(empId, "Bill", "Home", 15.25); t.Execute(); var e = PayrollDatabase.GetEmployee(empId); Assert.IsNotNull(e); var af = new UnionAffiliation(); e.Affiliation = af; const int memberId = 86; PayrollDatabase.AddUnionMember(memberId, e); var sct = new ServiceChargeTransaction(memberId, new DateTime(2020, 8, 8), 12.95); sct.Execute(); var sc = af.GetServiceCharge(new DateTime(2020, 8, 8)); Assert.IsNotNull(sc); Assert.AreEqual(12.95, sc.Amount, 0.001); }