Exemplo n.º 1
0
        public void Get_Payroll_For_2012_8_26()
        {
            var adapter = new PayrollAdapter();
            var items = adapter.GetPayrollWeekEnding(DateTime.Parse("2012-8-26"));

            var item = items.ToList().Single(x => x.Lastname == "Kutler");

            Assert.AreEqual(550, item.TotalMileage);
        }
Exemplo n.º 2
0
        public void Get_Payroll_For_2012_7_1()
        {
            var adapter = new PayrollAdapter();
            Payroll[] payrollItems = adapter.GetPayrollWeekEnding(DateTime.Parse("2012-7-1"));

            List<Payroll> list = new List<Payroll>(payrollItems);
            Payroll payroll = list.Single(x => x.Lastname == "Denton");

            Assert.AreEqual(32, payroll.RegularHours);
        }
Exemplo n.º 3
0
        public void Get_Niemeyer_Timesheets_For_Week_Ending()
        {
            var adapter = new PayrollAdapter();
            Payroll[] payrollItems = adapter.GetPayrollWeekEnding(new DateTime(2010, 12, 26));

            foreach (var payrollItem in payrollItems) {
                Console.WriteLine("{0}\t{1}\t{2}\t{3}",
                    payrollItem.EmployeeID,
                    payrollItem.Firstname,
                    payrollItem.Lastname,
                    payrollItem.WeekEnding.ToShortDateString()
                );
            }
        }
Exemplo n.º 4
0
        public void Get_Payroll_For_2013_1_6()
        {
            var adapter = new PayrollAdapter();
            /*
            adapter.ApproverList = new string[] {
                 "9d3c8120a649cebbe040007f01002438",
                 "9d3c8120b2a0cebbe040007f01002438",
                 "9d3c8120a636cebbe040007f01002438",
                 "9d3c8120a63ecebbe040007f01002438",
                 "4ea8a212000509f9dc0138f379c14bbf"
            };*/

            var periodPayroll = adapter.GetPayrollPeriodEnding(DateTime.Parse("2013-2-10")).ToList();
            var week1 = adapter.GetPayrollWeekEnding(DateTime.Parse("2013-2-3")).ToList();
            var week2 = adapter.GetPayrollWeekEnding(DateTime.Parse("2013-2-10")).ToList();

            const string employeeName = "Bonacci";
            List<Payroll> ePeriod = periodPayroll.Where(x => x.Lastname == employeeName).ToList();

            var eWeek1 = week1.Single(x => x.Lastname == employeeName);
            var eWeek2 = week2.Single(x => x.Lastname == employeeName);

            Assert.AreEqual(eWeek1.TotalMileage + eWeek2.TotalMileage, ePeriod[0].TotalMileage + ePeriod[1].TotalMileage);
        }
Exemplo n.º 5
0
 public void SetUp()
 {
     expectedWeekEnding = new DateTime(2010, 1, 5);
     expectedStartDate = new DateTime(2010, 1, 1);
     expectedStopDate = new DateTime(2010, 1, 10);
     gateway = new Mock<IGateway>();
     gateway.Setup(x => x.GetTimesheetsByFilter(It.IsAny<FilterBuilder>()))
         .Returns((Payroll[])null);
     expectedUserId = "1";
     expectedPayrollItems = null;
     actualPayrollItems = null;
     payrollAdapter = null;
 }
Exemplo n.º 6
0
        void Given_Payroll_Adapter_Including_Multiple_Weeks_For_Employee()
        {
            expectedPayrollItems = new Payroll[] {
                new Payroll() { WeekEnding = expectedWeekEnding.AddDays(-7), EmployeeID = "1337", TotalHours = 10, TotalMileage = 200 },
                new Payroll() { WeekEnding = expectedWeekEnding, EmployeeID = "1337", TotalHours = 15, TotalMileage = 100 }
            };

            gateway.Setup(g => g.GetTimesheetsByFilter(It.IsAny<FilterBuilder>()))
                .Returns(expectedPayrollItems);

            payrollAdapter = new PayrollAdapter(gateway.Object);
        }
Exemplo n.º 7
0
 void Given_Payroll_Adapter_Including_Approver_List()
 {
     payrollAdapter = new PayrollAdapter(gateway.Object);
     payrollAdapter.ApproverList = new string [] { "abc", "abd", "abe" };
 }
Exemplo n.º 8
0
 void Given_Payroll_Adapter()
 {
     payrollAdapter = new PayrollAdapter(gateway.Object);
 }
Exemplo n.º 9
0
        public void Get_Timesheets_For_Week_Ending()
        {
            var adapter = new PayrollAdapter();
            Payroll[] payrollItems = adapter.GetPayrollWeekEnding(new DateTime(2010, 12, 26));

            Console.WriteLine("length 1 = {0}", payrollItems.Length);
            foreach (var payrollItem in payrollItems) {
                Console.WriteLine("endDate = {0}", payrollItem.WeekEnding.ToShortDateString());
            }
        }
Exemplo n.º 10
0
        public void Get_Payroll_For_Period()
        {
            var adapter = new PayrollAdapter();
            var startDate = new DateTime(2011, 1, 1);
            var endDate = new DateTime(2011, 2, 1);
            var items = adapter.GetPayroll(startDate, endDate);

            Console.WriteLine("Returned {0} items", items.Length);
            foreach (var item in items) {
                Console.WriteLine("endDate = {0}", item.WeekEnding.ToShortDateString());
            }
        }
Exemplo n.º 11
0
        public void Get_Payroll_For_2014_4_6()
        {
            var adapter = new PayrollAdapter();
            var payrollPeriod = adapter.GetPayrollPeriodEnding(DateTime.Parse("2014-4-6")).ToList();
            IEnumerable<Payroll> payroll = payrollPeriod.Where(x => x.EmployeeID == "52938133000c12a6656d813f18f95b08");

            var totalMileage = payroll.Sum(p => p.TotalMileage);
            Assert.AreEqual(653.25, totalMileage);
        }
Exemplo n.º 12
0
 public void Get_Payroll_For_2014_3_30()
 {
     var adapter = new PayrollAdapter();
     var payrollPeriod = adapter.GetPayrollWeekEnding(DateTime.Parse("2014-3-30")).ToList();
     Payroll payroll = payrollPeriod.Single(x => x.EmployeeID == "52938133000c12a6656d813f18f95b08");
     Assert.AreEqual(237, payroll.TotalMileage);
     Assert.AreEqual(0, payroll.TotalPerDiem);
 }
Exemplo n.º 13
0
        public void Get_Payroll_For_2013_4_14()
        {
            var adapter = new PayrollAdapter();
            var payrollPeriod = adapter.GetPayrollWeekEnding(DateTime.Parse("2013-4-21")).ToList();

            Payroll payroll = payrollPeriod.Single(x => x.EmployeeID == "4ec2cd5f00352d8e7f89ffc2f9e7ac15");

            Assert.AreEqual(40, payroll.TotalHours);
            Assert.AreEqual(20, payroll.SuspensionHours);
        }
Exemplo n.º 14
0
        public void Get_Payroll_For_2013_3_10_Combined()
        {
            var adapter = new PayrollAdapter();

            var periodPayroll = adapter.GetCombinedPayrollPeriodEnding(DateTime.Parse("2013-3-10")).ToList();

            Payroll ePeriod = periodPayroll.Single(x => x.EmployeeID == "4ebcb37b001928943846f3a774d7cb33");

            Assert.AreEqual(235, ePeriod.TotalMileage);
        }