Exemplo n.º 1
0
        public void TestPaySingleCommissionedEmployeeWithTwoSales()
        {
            int empId = 1;

            var addTx = new AddCommissionedEmployee(empId, "Bob", "Home", 1000, 0.2M);

            addTx.Execute();

            var saleTx1 = new SalesReceiptTransaction(100, new Date(11, 9, 2001), empId);

            saleTx1.Execute();

            var saleTx2 = new SalesReceiptTransaction(500, new Date(11, 9, 2001), empId);

            saleTx2.Execute();

            var payDate  = new Date(11, 16, 2001);
            var paydayTx = new PaydayTransaction(payDate);

            paydayTx.Execute();

            var paycheck = paydayTx.GetPaycheck(empId);

            ValidateCommisionedPaycheck(paydayTx, empId, payDate, 1120M);
        }
Exemplo n.º 2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            DateTime          startdate = Convert.ToDateTime(TextBox1.Text);
            DateTime          enddate   = Convert.ToDateTime(TextBox2.Text);
            int               id        = int.Parse(TextBox3.Text);
            PayrollDatabase   database  = new FunctionPayrollDatabase();
            Employee          ee        = database.GetEmployee(id);
            Paycheck          st        = new Paycheck(startdate, enddate);
            double            pay       = ee.Classification.CalculatePay(st);
            PaydayTransaction pt        = new PaydayTransaction(enddate, database);

            pt.Execute();
            Paycheck pc   = pt.GetPaycheck(id);
            DateTime date = Convert.ToDateTime(TextBox4.Text);

            if (pc != null && date >= enddate)
            {
                string payMethod = TextBox5.Text;
                database.pay(id, pay, date, payMethod);
                MessageBox.Show("共付 " + pay + " 元", "通知");
            }
            else
            {
                MessageBox.Show("未到支付日期");
            }
        }
Exemplo n.º 3
0
        public void TestPayCommissionedEmployeeTwoSalesReceipts()
        {
            const int empId = 30;
            var       t     = new AddCommissionedEmployee(empId, "Bob", "Home", 2500.00, 3.2);

            t.Execute();
            var payDate = new DateTime(2020, 7, 17);
            var srt     = new SalesReceiptTransaction(payDate, 100.0, empId);

            srt.Execute();
            var srt2 = new SalesReceiptTransaction(payDate.AddDays(-1), 200.0, empId);

            srt2.Execute();
            var pt = new PaydayTransaction(payDate);

            pt.Execute();

            var pc = pt.GetPaycheck(empId);

            Assert.IsNotNull(pc);
            Assert.AreEqual(payDate, pc.PayDate);
            Assert.AreEqual((100.0 + 200) * 3.2, pc.GrossPay, 0.001);
            Assert.AreEqual("Hold", pc.GetField("Disposition"));
            Assert.AreEqual(0.0, pc.Deductions, 0.001);
            Assert.AreEqual((100.0 + 200) * 3.2, pc.NetPay, 0.001);
        }
Exemplo n.º 4
0
        public void TestPayCommissionedEmployeeNoSalesReceipts()
        {
            const int empId = 28;
            var       t     = new AddCommissionedEmployee(empId, "Bob", "Home", 2500.00, 3.2);

            t.Execute();

            var payDate = new DateTime(2020, 7, 17);
            var pt      = new PaydayTransaction(payDate);

            pt.Execute();
            var pc = pt.GetPaycheck(empId);

            Assert.IsNotNull(pc);
            Assert.AreEqual(payDate, pc.PayDate);
            Assert.AreEqual(0.0, pc.GrossPay, 0.001);
            Assert.AreEqual("Hold", pc.GetField("Disposition"));
            Assert.AreEqual(0.0, pc.Deductions, 0.001);
            Assert.AreEqual(0.0, pc.NetPay, 0.001);

            var payDate2 = new DateTime(2020, 7, 31);
            var pt2      = new PaydayTransaction(payDate2);

            pt2.Execute();

            var pc2 = pt2.GetPaycheck(empId);

            Assert.IsNotNull(pc2);
            Assert.AreEqual(payDate2, pc2.PayDate);
            Assert.AreEqual(2500.0, pc2.GrossPay, 0.001);
            Assert.AreEqual("Hold", pc2.GetField("Disposition"));
            Assert.AreEqual(0.0, pc2.Deductions, 0.001);
            Assert.AreEqual(2500.0, pc2.NetPay, 0.001);
        }
Exemplo n.º 5
0
        public void TestHourlyUnionMemberServiceCharge()
        {
            var empId = 1;
            var addTx = new AddHourlyEmployee(empId, "Bill", "Home", 15.24M);

            addTx.Execute();
            int memberId = 7734;
            var memberTx = new ChangeMemberTransaction(empId, memberId, 9.42M);

            memberTx.Execute();
            var payDate         = new Date(11, 9, 2001);
            var serviceChargeTx = new ServiceChargeTransaction(memberId, payDate, 19.42M);

            serviceChargeTx.Execute();
            var timecardTx = new TimeCardTransaction(payDate, 8, empId);

            timecardTx.Execute();
            var payDayTx = new PaydayTransaction(payDate);

            payDayTx.Execute();
            var paycheck = payDayTx.GetPaycheck(empId);

            Assert.IsNotNull(paycheck, "No paycheck available");
            Assert.AreEqual(payDate, paycheck.PayPeriodEndDate);
            Assert.AreEqual(8 * 15.24M, paycheck.GrossPay);
            Assert.AreEqual("Hold", paycheck.GetField("Disposition"));
            Assert.AreEqual(9.42M + 19.42M, paycheck.Deductions);
            Assert.AreEqual((8 * 15.24M) - (9.42M + 19.42M), paycheck.NetPay);
        }
Exemplo n.º 6
0
        public void HourlyUnionMemberServiceCharge()
        {
            int empid           = 31;
            AddHourlyEmployee t = new AddHourlyEmployee(empid, "Bill", "Home", 15.24);

            t.Execute();
            int memberId = 7664;
            ChangeMemberTransaction cmt = new ChangeMemberTransaction(empid, memberId, 9.42);

            cmt.Execute();
            DateTime payDate             = new DateTime(2015, 11, 27);
            ServiceChargeTransaction sct = new ServiceChargeTransaction(memberId, payDate, 19.42);

            sct.Execute();
            TimeCardTransaction tct = new TimeCardTransaction(payDate, 8.0, empid);

            tct.Execute();
            PaydayTransaction pt = new PaydayTransaction(payDate);

            pt.Execute();
            Paycheck pc = pt.GetPaycheck(empid);

            Assert.IsNotNull(pc);
            Assert.AreEqual(payDate, pc.PayPeriodEndDate);
            Assert.AreEqual(8 * 15.24, pc.GrossPay, .001);
            Assert.AreEqual("HOLD", pc.GetField("Disposition"));
            Assert.AreEqual(9.42 + 19.42, pc.Deductions, .001);
            Assert.AreEqual((8 * 15.24) - (9.42 + 19.42), pc.NetPay, .001);
        }
Exemplo n.º 7
0
        public void TestHourlyUnionMemberServiceCharge()
        {
            int empId           = 1;
            AddHourlyEmployee t = new AddHourlyEmployee(empId, "Kubing", "Home", 15.24, database);

            t.Execute();

            int memberId = 7734;
            ChangeMemberTransaction cmt = new ChangeMemberTransaction(empId, memberId, 9.42, database);

            cmt.Execute();

            DateTime payDate             = new DateTime(2001, 11, 9);
            ServiceChargeTransaction sct = new ServiceChargeTransaction(memberId, payDate, 19.42, database);

            sct.Execute();

            TimeCardTransaction tct = new TimeCardTransaction(payDate, 8.0, empId, database);

            tct.Execute();

            PaydayTransaction pt = new PaydayTransaction(payDate, database);

            pt.Execute();

            Paycheck pc = pt.GetPaycheck(empId);

            Assert.IsNotNull(pc);
            Assert.AreEqual(payDate, pc.PayPeriodEnd);
            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);
        }
Exemplo n.º 8
0
        public void SalariedUnionMemberDuesTest()
        {
            var empId             = 1;
            var name              = "Bogdan";
            var address           = "Home";
            var salary            = 1000.0;
            AddSalariedEmployee t = new AddSalariedEmployee(empId, name, address, salary);

            t.Execute();
            var memberId = 7734;
            var dues     = 9.42;
            ChangeMemberTransaction cmt = new ChangeMemberTransaction(empId, memberId, dues);

            cmt.Execute();
            var 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(salary, pc.GrossPay, .001);
            Assert.AreEqual(5 * dues, pc.Deductions, .001);
            Assert.AreEqual(salary - (5 * dues), pc.NetPay, .001);
        }
Exemplo n.º 9
0
        public void TestSalariedUnionMemberDues()
        {
            int empId             = 1;
            AddSalariedEmployee t = new AddSalariedEmployee(empId, "Kubing", "Home", 1000.0, database);

            t.Execute();

            int memberId = 7734;
            ChangeMemberTransaction cmt = new ChangeMemberTransaction(empId, memberId, 9.42, database);

            cmt.Execute();

            DateTime          payDate = new DateTime(2001, 11, 30);
            PaydayTransaction pt      = new PaydayTransaction(payDate, database);

            pt.Execute();

            Paycheck pc = pt.GetPaycheck(empId);

            Assert.IsNotNull(pc);
            Assert.AreEqual(payDate, pc.PayPeriodEnd);
            Assert.AreEqual(1000.0, pc.GrossPay, 0.001);
            Assert.AreEqual("Hold", pc.GetField("Disposition"));
            Assert.AreEqual(9.42 * 5, pc.Deductions, 0.001);
            Assert.AreEqual(1000.0 - 9.42 * 5, pc.NetPay, 0.001);
        }
        public void TestPaySalariedUnionMemberDues()
        {
            // Arrange
            var employeeId = 1;
            var salary     = 2400;

            new AddSalariedEmployeeTransaction(employeeId, "Adam", "Address", salary).Execute();

            var commisionRate = 9.25;
            var unionMemberId = 22;

            new ChangeEmployeeUnionAffiliationTransaction(employeeId, unionMemberId, commisionRate).Execute();

            var fridayDate        = new DateTime(2011, 1, 31);
            var paydayTransaction = new PaydayTransaction(fridayDate);

            // Act
            paydayTransaction.Execute();
            var paycheck           = paydayTransaction.GetPaycheck(employeeId);
            var expectedDeductions = 4 * commisionRate;

            // Assert
            Assert.IsNotNull(paycheck);
            Assert.AreEqual(fridayDate, paycheck.EndDate);
            Assert.AreEqual(salary, paycheck.GrossPay);
            Assert.AreEqual(PaymentMethodType.Hold, paycheck.Disposition);
            Assert.AreEqual(expectedDeductions, paycheck.Deductions);
            Assert.AreEqual(salary - expectedDeductions, paycheck.NetPay);
        }
        public void PaySingleCommissionedEmployeeTwoSalesReceipts()
        {
            int empId = 328;
            AddCommissionedEmployee t = new AddCommissionedEmployee(empId, "Bill", "Home", 1000, 15);

            t.Execute();

            DateTime payDate            = new DateTime(2001, 11, 7); // Friday
            SalesReceiptTransaction tct = new SalesReceiptTransaction(payDate, 200.0, empId);

            tct.Execute();

            SalesReceiptTransaction tct2 = new SalesReceiptTransaction(payDate.AddDays(-1), 100.0, empId);

            tct.Execute();

            PaydayTransaction pt = new PaydayTransaction(payDate);

            pt.Execute();

            double commissionPay = ((200 * 15) / 100) + ((100 * 15) / 100);
            double salaryHalfPay = (1000 / 2);
            var    pay           = commissionPay + salaryHalfPay;

            ValidateHourlyPaycheck(pt, empId, payDate, pay);
        }
Exemplo n.º 12
0
        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 TestPaySingleCommisionedEmployeeWithSalesReceiptsSpanningTwoPayPeriods()
        {
            // Arrange
            var employeeId    = 1;
            var commisionRate = 0.25;
            var salary        = 2400;

            new AddCommisionedEmployeeTransaction(employeeId, "Adam", "Address", salary, commisionRate).Execute();

            var date        = DateTime.Parse("2018-02-4");
            var salesAmount = 200;

            new SalesReceiptTransaction(employeeId, date, salesAmount).Execute();

            var lastPayPeriodDate = date - TimeSpan.FromDays(14);
            var salesAmount1      = 150;

            new SalesReceiptTransaction(employeeId, lastPayPeriodDate, salesAmount1).Execute();

            var fridayDate        = DateTime.Parse("2018-02-9");
            var paydayTransaction = new PaydayTransaction(fridayDate);

            // Act
            paydayTransaction.Execute();
            var paycheck    = paydayTransaction.GetPaycheck(employeeId);
            var expectedPay = salary + salesAmount * commisionRate;

            // Assert
            Assert.IsNotNull(paycheck);
            Assert.AreEqual(fridayDate, paycheck.EndDate);
            Assert.AreEqual(expectedPay, paycheck.GrossPay);
            Assert.AreEqual(PaymentMethodType.Hold, paycheck.Disposition);
            Assert.AreEqual(0, paycheck.Deductions);
            Assert.AreEqual(expectedPay, paycheck.NetPay);
        }
        public void TestPaySingleHourlyEmployeeWithTwoTimeCards()
        {
            // Arrange
            var employeeId = 1;
            var hourlyRate = 15.25;

            new AddHourlyEmployeeTransaction(employeeId, "Adam", "Address", hourlyRate).Execute();

            var fridayDate = DateTime.Parse("2018-02-16");
            var hours1     = 5;
            var hours2     = 2;

            new TimeCardTransaction(employeeId, fridayDate, hours1).Execute();
            new TimeCardTransaction(employeeId, fridayDate.Subtract(TimeSpan.FromDays(2)), hours2).Execute();
            var paydayTransaction = new PaydayTransaction(fridayDate);

            // Act
            paydayTransaction.Execute();
            var paycheck    = paydayTransaction.GetPaycheck(employeeId);
            var expectedPay = (hours1 + hours2) * hourlyRate;

            // Assert
            Assert.IsNotNull(paycheck);
            Assert.AreEqual(fridayDate, paycheck.EndDate);
            Assert.AreEqual(expectedPay, paycheck.GrossPay);
            Assert.AreEqual(PaymentMethodType.Hold, paycheck.Disposition);
            Assert.AreEqual(0, paycheck.Deductions);
            Assert.AreEqual(expectedPay, paycheck.NetPay);
        }
Exemplo n.º 15
0
        public void PaySingleCommissionedEmployeeWithSalesReceiptsSpanningTwoPayPeriods()
        {
            int empId = 2;
            AddCommissionedEmployee t = new AddCommissionedEmployee(
                empId, "Bob", "Home", 1000.00, 10.00, database);

            t.Execute();

            DateTime payDate = new DateTime(2001, 11, 16); // Friday
            DateTime dateInPreviousPayPeriod = new DateTime(2001, 11, 2);

            SalesReceiptTransaction srt = new SalesReceiptTransaction(
                payDate, 100.00, empId, database);

            srt.Execute();
            SalesReceiptTransaction srt2 = new SalesReceiptTransaction(
                dateInPreviousPayPeriod, 200.00, empId, database);

            srt2.Execute();
            PaydayTransaction pt = new PaydayTransaction(payDate, database);

            pt.Execute();

            ValidatePaycheck(pt, empId, payDate, 1010.00);
        }
Exemplo n.º 16
0
        public void PaySingleHourlyEmployeeTwoTimeCards()
        {
            int               empId      = 3;
            string            name       = "Marek";
            string            address    = "Home";
            double            hourlyRate = 15.25;
            int               hours1     = 2;
            int               hours2     = 5;
            AddHourlyEmployee t          = new AddHourlyEmployee(empId, name, address, hourlyRate);

            t.Execute();
            DateTime            payDate = new DateTime(2001, 11, 9); // piątek
            TimeCardTransaction tc1     = new TimeCardTransaction(payDate, hours1, empId);

            tc1.Execute();
            TimeCardTransaction tc2 = new TimeCardTransaction(payDate.AddDays(-1), hours2, empId);

            tc2.Execute();
            PaydayTransaction pt = new PaydayTransaction(payDate);

            pt.Execute();
            var pc = pt.GetPayCheck(empId);

            ValidatePayCheck(pt, empId, payDate, (7) * hourlyRate);
        }
Exemplo n.º 17
0
        public void HourlyUnionMemberServiceCharge()
        {
            int       empId    = SetupHourlyEmployee();
            const int memberId = 7734;
            var       cmt      = new ChangeMemberTransaction(empId, memberId, 9.42);

            cmt.Execute();

            var payDate = new DateTime(2001, 11, 9);
            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();

            Paycheck pc = PaydayTransaction.GetPaycheck(empId);

            Assert.NotNull(pc);
            Assert.Equal(payDate, pc.PayPeriodEndDate);
            Assert.Equal(8 * 15.25, pc.GrossPay);
            Assert.Equal("Hold", pc.GetField("Disposition"));
            Assert.Equal(9.42 + 19.42, pc.Deductions);
            Assert.Equal((8 * 15.25) - (9.42 + 19.42), pc.NetPay);
        }
Exemplo n.º 18
0
        private void ValidatePayCheck(PaydayTransaction pt, int empId, DateTime date, double pay)
        {
            PayCheck pc = pt.GetPayCheck(empId);

            Assert.IsNotNull(pc);
            Assert.AreEqual(date, pc.PayDate);
            Assert.AreEqual(pay, pc.GrossPay, .001);
            Assert.AreEqual(0.0, pc.Deductions, .001);
            Assert.AreEqual(pay, pc.NetPay, .001);
        }
Exemplo n.º 19
0
        public void PaySingleSalariedEmployee()
        {
            int empId   = SetupSalariedEmployee();
            var payDate = new DateTime(2001, 11, 30);

            var pt = new PaydayTransaction(payDate);

            pt.Execute();
            ValidateNoDeductionPaycheck(empId, payDate, 2300.0);
        }
Exemplo n.º 20
0
        private static void ValidateNoDeductionPaycheck(int empId, DateTime payDate, double pay)
        {
            Paycheck pc = PaydayTransaction.GetPaycheck(empId);

            Assert.NotNull(pc);
            Assert.Equal(payDate, pc.PayPeriodEndDate);
            Assert.Equal(pay, pc.GrossPay);
            Assert.Equal("Hold", pc.GetField("Disposition"));
            Assert.Equal(0.0, pc.Deductions);
            Assert.Equal(pay, pc.NetPay);
        }
        private void ValidateHourlyPaycheck(PaydayTransaction pt, int empid, DateTime payDate, double pay)
        {
            Paycheck pc = pt.GetPaycheck(empid, payDate);

            Assert.IsNotNull(pc);
            Assert.AreEqual(payDate, pc.PayDate);
            Assert.AreEqual(pay, pc.GrossPay, .001);
            Assert.AreEqual("Hold", pc.GetField("Disposition"));
            Assert.AreEqual(0.0, pc.Deductions, .001);
            Assert.AreEqual(pay, pc.NetPay, .001);
        }
Exemplo n.º 22
0
        private void ValidateHourlyPaycheck(PaydayTransaction paydayTx, int empId, Date payDate, decimal pay)
        {
            var paycheck = paydayTx.GetPaycheck(empId);

            Assert.IsNotNull(paycheck);
            Assert.AreEqual(payDate, paycheck.PayPeriodEndDate);
            Assert.AreEqual(pay, paycheck.GrossPay);
            Assert.AreEqual("Hold", paycheck.GetField("Disposition"));
            Assert.AreEqual(0.0M, paycheck.Deductions);
            Assert.AreEqual(pay, paycheck.NetPay);
        }
Exemplo n.º 23
0
        public void PayingSingleHourlyEmployeeNoTimeCards()
        {
            int empId   = SetupHourlyEmployee();
            var payDate = new DateTime(2001, 11, 9); // Friday

            var pt = new PaydayTransaction(payDate);

            pt.Execute();

            ValidateNoDeductionPaycheck(empId, payDate, 0.0);
        }
Exemplo n.º 24
0
        private void ValidateCommissionedPaycheck(PaydayTransaction pt, int empId, DateTime payDate, double pay)
        {
            Paycheck pc = pt.GetPaycheck(empId);

            Assert.IsNotNull(pc);
            Assert.AreEqual(payDate, pc.PayPeriodEnd);
            Assert.AreEqual(pay, pc.GrossPay, 0.01);
            Assert.AreEqual("Hold", pc.GetField("Disposition"));
            Assert.AreEqual(0.0, pc.Deductions, 0.01);
            Assert.AreEqual(pay, pc.NetPay, 0.01);
        }
Exemplo n.º 25
0
        public void PayingSingleHourlyEmployeeWithouTTimeCards()
        {
            int               employeeId = AddHourlyEmployee();
            DateTime          payDate    = new DateTime(2019, 4, 26);
            PaydayTransaction pt         = new PaydayTransaction(payDate);

            pt.Execute();

            PayCheck pc = pt.GetPayCheck(employeeId);

            ValidateHourlyPayCheck(payDate, pc, 0.0);
        }
Exemplo n.º 26
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);
        }
Exemplo n.º 27
0
        public void TestPayingSingleHourlyEmployeeNoTimeCards()
        {
            const int empId = 19;
            var       t     = new AddHourlyEmployee(empId, "Bill", "Home", 15.25);

            t.Execute();
            var payDate = new DateTime(2020, 11, 6);
            var pt      = new PaydayTransaction(payDate);

            pt.Execute();
            ValidateHourlyPaycheck(pt, empId, payDate, 0.0);
        }
Exemplo n.º 28
0
        public void PayingSingleCommissionedEmployeeNoReceipts()
        {
            int empId = 2;
            AddCommissionedEmployee t = new AddCommissionedEmployee(
                empId, "Bill", "Home", 1500, 10, database);

            t.Execute();
            DateTime          payDate = new DateTime(2001, 11, 16); // Payday
            PaydayTransaction pt      = new PaydayTransaction(payDate, database);

            pt.Execute();
            ValidatePaycheck(pt, empId, payDate, 1500.0);
        }
Exemplo n.º 29
0
        public void PayingSingleHourlyEmployeeNoTimeCards()
        {
            int empId           = 2;
            AddHourlyEmployee t = new AddHourlyEmployee(
                empId, "Bill", "Home", 15.25, database);

            t.Execute();
            DateTime          payDate = new DateTime(2001, 11, 9); // Friday
            PaydayTransaction pt      = new PaydayTransaction(payDate, database);

            pt.Execute();
            ValidatePaycheck(pt, empId, payDate, 0.0);
        }
Exemplo n.º 30
0
        public void PaySingleSalariedEmployeeOnWrongDate()
        {
            int empId   = SetupSalariedEmployee(SalariedEmployeeId + 10);
            var payDate = new DateTime(2001, 11, 29);

            var pt = new PaydayTransaction(payDate);

            pt.Execute();

            Paycheck pc = PaydayTransaction.GetPaycheck(empId);

            Assert.Null(pc);
        }