Example #1
0
        public async Task PayingSingleHorlyEmployeeNoTimeCards()
        {
            int empId           = 12;
            AddHourlyEmployee t = new AddHourlyEmployee(empId, "Bill", "Home", 15.25);
            await t.ExecuteAsync();

            DateTime          payDate = new DateTime(2001, 11, 9);
            PaydayTransaction pt      = new PaydayTransaction(payDate);
            await pt.ExecuteAsync();

            ValidatePaycheck(pt, empId, payDate, 0.0);
        }
Example #2
0
        public async Task PyaSingleSalariedEmployeeOnWrongDate()
        {
            int empId             = 11;
            AddSalariedEmployee t = new AddSalariedEmployee(empId, "Bob", "Home", 1000);
            await t.ExecuteAsync();

            DateTime          payDate = new DateTime(2001, 11, 29);
            PaydayTransaction pt      = new PaydayTransaction(payDate);
            await pt.ExecuteAsync();

            Paycheck pc = pt.GetPaycheck(empId);

            Assert.Null(pc);
        }
Example #3
0
        public async Task PaySingleSalariedEmployee()
        {
            int empId             = 10;
            AddSalariedEmployee t = new AddSalariedEmployee(empId, "Bob", "Home", 1000.00);
            await t.ExecuteAsync();

            DateTime          payDate = new DateTime(2001, 11, 30);
            PaydayTransaction pt      = new PaydayTransaction(payDate);
            await pt.ExecuteAsync();

            Paycheck pc = pt.GetPaycheck(empId);

            Assert.NotNull(pc);
            Assert.Equal(payDate, pc.PayPeriodEndDate);
            Assert.Equal(1000, pc.GrossPay);
            Assert.Equal("Hold", pc.GetField("Disposition"));
            Assert.Equal(0, pc.Deduction);
            Assert.Equal(1000, pc.NetPay);
        }