Ejemplo n.º 1
0
        public void ApplyPenaltyRates_OnSunday(double hrsForSunday, double hrsForMonday,
                                               double hrsForTuesday, double hrsForWednesday, double hrsForThursday,
                                               double hrsForFriday, double hrsForSaturday)
        {
            var timesheet      = new Timesheets();
            var setRatePerHour = timesheet.SetStaffHourlyRate(40);
            var hrsForWeek     = timesheet.CalculateHoursForWeek(hrsForSunday, hrsForMonday, hrsForTuesday,
                                                                 hrsForWednesday, hrsForThursday, hrsForFriday, hrsForSaturday);

            var costForTheWeek = timesheet.CalculateCostForTheWeek();
            var result         = timesheet.Apply_PenaltyRateOf2Percent_OnSunday();

            Assert.That(result, Is.EqualTo(0.80000000000000004d));
        }
Ejemplo n.º 2
0
        public void GetTotalCostForTheWeek(double hrsForSunday, double hrsForMonday,
                                           double hrsForTuesday, double hrsForWednesday, double hrsForThursday,
                                           double hrsForFriday, double hrsForSaturday)
        {
            var timesheet                 = new Timesheets();
            var setRatePerHour            = timesheet.SetStaffHourlyRate(40);
            var setPenaltyForSunday       = timesheet.Apply_PenaltyRateOf2Percent_OnSunday();
            var setPenaltyRateForSaturday = timesheet.Apply_PenaltyRateOfOneAndHalfPercent_OnSaturday();
            var hrsForWeek                = timesheet.CalculateHoursForWeek(hrsForSunday, hrsForMonday, hrsForTuesday,
                                                                            hrsForWednesday, hrsForThursday, hrsForFriday, hrsForSaturday);

            var result = timesheet.CalculateCostForTheWeek();

            Assert.That(result, Is.EqualTo(763.39999999999998d));
        }