Пример #1
0
        /// <summary>
        /// Calculates hours worked before midnight, after bedtime.
        /// </summary>
        /// <returns><see cref="int"/> representing the hours worked before bed, to the nearest hour</returns>
        public int CalculateHoursBetweenBedtimeAndMidnight()
        {
            switch (_bedTimePeriod)
            {
            case TIME_OF_DAY.AM:
                return(0);

                break;

            default:
                if (babysitterWorksPastMidnight())
                {
                    return((int)Math.Round(ONE_MINUTE_TO_MIDNIGHT.Minus(_bedTime) + (1.0 / 60.0)));
                }
                return((int)Math.Round(_endTime.Minus(_bedTime)));

                break;
            }
        }
Пример #2
0
 private int calculateHoursBeforeBedtime_MorningStart()
 {
     return((int)Math.Round(_bedTime.Minus(_startTime)));
 }