コード例 #1
0
        public void WeekTest()
        {
            DurationUtil.Week.Should().Be(TimeSpan.FromDays(TimeSpec.DaysPerWeek));

            DurationUtil.Weeks(0).Should().Be(TimeSpan.Zero);
            DurationUtil.Weeks(1).Should().Be(TimeSpan.FromDays(TimeSpec.DaysPerWeek));
            DurationUtil.Weeks(2).Should().Be(TimeSpan.FromDays(TimeSpec.DaysPerWeek * 2));

            DurationUtil.Weeks(-1).Should().Be(TimeSpan.FromDays(TimeSpec.DaysPerWeek * -1));
            DurationUtil.Weeks(-2).Should().Be(TimeSpan.FromDays(TimeSpec.DaysPerWeek * -2));
        }