示例#1
0
        public void Subtract_2359From101220182359_Returns10122018()
        {
            var timeCalculator = new WorkTimeCalculator(new SimpleWorkDayCalendar(TimeSpan.FromHours(10), TimeSpan.FromHours(18)));
            var expected       = new DateTime(2018, 12, 10, 10, 0, 0);
            var actual         = timeCalculator.Subtract(new DateTime(2018, 12, 12, 17, 59, 0), new WorkTime(23 * 60 + 59));

            Assert.Equal(expected, actual);
        }
示例#2
0
        public void Subtract_201600From311220180600_Returns101220181400()
        {
            var timeCalculator = new WorkTimeCalculator(new SimpleWorkDayCalendar(TimeSpan.FromHours(10), TimeSpan.FromHours(18)));
            var expected       = new DateTime(2018, 12, 10, 15, 0, 0);
            var actual         = timeCalculator.Subtract(new DateTime(2019, 01, 9, 15, 0, 0), new WorkTime(20 * 8 * 60 + 16 * 60));

            Assert.Equal(expected, actual);
        }
示例#3
0
        public void Subtract_4900From121120180100_Returns10122018()
        {
            var timeCalculator = new WorkTimeCalculator(new SimpleWorkDayCalendar(TimeSpan.FromHours(10), TimeSpan.FromHours(18)));
            var expected       = new DateTime(2018, 12, 10, 10, 0, 0);
            var actual         = timeCalculator.Subtract(new DateTime(2018, 12, 18, 11, 0, 0), new WorkTime(49 * 60));

            Assert.Equal(expected, actual);
        }