public async Task ChangeSalariedTransaction() { int empId = 7; AddCommissionedEmployee t = new AddCommissionedEmployee(empId, "Lance", "Home", 2500, 3.2); await t.ExecuteAsync(); ChangeSalariedTransaction cht = new ChangeSalariedTransaction(empId, 2500); await cht.ExecuteAsync(); Employee e = await PayrollDatabase.GetEmployeeAsync(empId); Assert.NotNull(e); Classification.PaymentClassification pc = e.Classification; Assert.NotNull(pc); Assert.True(pc is Payroll.Classification.SalariedClassification); Payroll.Classification.SalariedClassification sc = pc as Payroll.Classification.SalariedClassification; Assert.Equal(2500, sc.Salary); IPaymentSchedule ps = e.Schedule; Assert.True(ps is BiWeeklySchedule); }
public async Task AddSalariedEmployee() { int empId = 1; AddSalariedEmployee t = new AddSalariedEmployee(empId, "Bob", "Home", 1000.0); await t.ExecuteAsync(); Employee e = await PayrollDatabase.GetEmployeeAsync(empId); Assert.Equal("Bob", e.Name); Classification.PaymentClassification pc = e.Classification; Assert.True(pc is Payroll.Classification.SalariedClassification); Payroll.Classification.SalariedClassification sc = pc as Payroll.Classification.SalariedClassification; Assert.Equal(1000.00, sc.Salary); IPaymentSchedule ps = e.Schedule; Assert.True(ps is MonthlySchedule); IPaymentMethod pm = e.Method; Assert.True(pm is HoldMethod); }