コード例 #1
0
        public void GivenTimePeriodInput_ThenCorrectDateRangeIsReturned(DateTime currentDateTime, TimePeriod inputTimePeriod, DateRange expectedDateRange)
        {
            var expectedDateTimeUtcNow = new DateTimeOffset(currentDateTime);

            _mockSystemClock.Setup(clock => clock.UtcNow).Returns(expectedDateTimeUtcNow);
            var helper = new TimePeriodHelper(_mockSystemClock.Object);

            var returnedDateRange = helper.ResolveDateRange(inputTimePeriod);

            Assert.Equal(expectedDateRange, returnedDateRange);
        }