private (ActualWorkTimeService awt, TargetWorkTimeService twt) prepare(DateTime theDay)
        {
            var timeProvider = new FakeDateTimeProvider(theDay);

            var fs  = new FeiertagService(timeProvider);
            var cs  = new CoronaService(config, fs);
            var tbs = new TimeBookingsService(tbslogger, ctx);
            var awt = new ActualWorkTimeService(tbs, timeProvider);

            var twt = new TargetWorkTimeService(config, cs);

            return(awt, twt);
        }
Beispiel #2
0
        public void NormalDay202()
        {
            var theDate  = new DateTime(2020, 04, 20);
            var fService = new FeiertagService(new FakeDateTimeProvider(theDate));
            var corona   = new CoronaService(config, fService);

            var sut = new TargetWorkTimeService(config, corona);

            var(plannedWorkTime, coronaDelta, targetWorkTime, targetPause) = sut.LoadData(theDate);

            plannedWorkTime.TotalHours.Should().Be(8.2);
            coronaDelta.TotalHours.Should().Be(0.5);
            targetWorkTime.TotalHours.Should().Be(7.7);
            targetPause.TotalMinutes.Should().Be(30);
        }
Beispiel #3
0
        public void Friday30()
        {
            var theDate  = new DateTime(2020, 04, 24);
            var fService = new FeiertagService(new FakeDateTimeProvider(theDate));
            var corona   = new CoronaService(config, fService);

            var sut = new TargetWorkTimeService(config, corona);

            var(plannedWorkTime, coronaDelta, targetWorkTime, targetPause) = sut.LoadData(theDate);

            plannedWorkTime.TotalMinutes.Should().Be(342);
            coronaDelta.TotalMinutes.Should().Be(342);
            targetWorkTime.TotalMinutes.Should().Be(0);
            targetPause.TotalMinutes.Should().Be(0);
        }