public void TestAddSalariedEmployee() { int empId = 1; AddSalariedEmployee t = new AddSalariedEmployee(empId, "Bob", "Home", 1000.00); t.Execute(); Employee e = PayrollDatabase.GetEmployee(empId); Assert.AreEqual("Bob", e.Name); PaymentClassification pc = e.Classification; Assert.IsTrue(pc is SalariedClassification); SalariedClassification sc = pc as SalariedClassification; Assert.AreEqual(1000.00, sc.Salary, .001); PaymentSchedule ps = e.Schedule; Assert.IsTrue(ps is MonthlySchedule); PaymentMethod pm = e.Method; Assert.IsTrue(pm is HoldMethod); }
public void TestChangeSalariedTransaction() { int empId = 9; AddSalariedEmployee t = new AddSalariedEmployee(empId, "Lance", "Home", 2500); t.Execute(); ChangeSalariedTransaction cst = new ChangeSalariedTransaction(empId, 200); cst.Execute(); Employee e = PayrollDatabase.GetEmployee(empId); Assert.IsNotNull(e); PaymentClassification pc = e.Classification; Assert.IsNotNull(pc); Assert.IsTrue(pc is SalariedClassification); SalariedClassification sc = pc as SalariedClassification; Assert.AreEqual(200, sc.Salary, .001); PaymentSchedule ps = e.Schedule; Assert.IsTrue(ps is MonthlySchedule); }
public void TestChangeMailTransaction() { int empId = 10; AddSalariedEmployee t = new AddSalariedEmployee(empId, "Lance", "Home", 1000.00); t.Execute(); ChangeMailTransaction cmt = new ChangeMailTransaction(empId); cmt.Execute(); Employee e = PayrollDatabase.GetEmployee(empId); Assert.IsNotNull(e); PaymentMethod pm = e.Method; Assert.IsNotNull(pm); Assert.IsTrue(pm is MailMethod); }