AddDays() public static method

요일 계산을 수행한다.
public static AddDays ( this day, int days ) : DayOfWeek
day this
days int
return DayOfWeek
コード例 #1
0
        public void AddDayTest()
        {
            TimeTool.AddDays(DayOfWeek.Monday, 14).Should().Be(DayOfWeek.Monday);
            TimeTool.AddDays(DayOfWeek.Tuesday, 14).Should().Be(DayOfWeek.Tuesday);
            TimeTool.AddDays(DayOfWeek.Wednesday, 14).Should().Be(DayOfWeek.Wednesday);
            TimeTool.AddDays(DayOfWeek.Thursday, 14).Should().Be(DayOfWeek.Thursday);
            TimeTool.AddDays(DayOfWeek.Friday, 14).Should().Be(DayOfWeek.Friday);
            TimeTool.AddDays(DayOfWeek.Saturday, 14).Should().Be(DayOfWeek.Saturday);
            TimeTool.AddDays(DayOfWeek.Sunday, 14).Should().Be(DayOfWeek.Sunday);

            TimeTool.AddDays(DayOfWeek.Monday, -14).Should().Be(DayOfWeek.Monday);
            TimeTool.AddDays(DayOfWeek.Tuesday, -14).Should().Be(DayOfWeek.Tuesday);
            TimeTool.AddDays(DayOfWeek.Wednesday, -14).Should().Be(DayOfWeek.Wednesday);
            TimeTool.AddDays(DayOfWeek.Thursday, -14).Should().Be(DayOfWeek.Thursday);
            TimeTool.AddDays(DayOfWeek.Friday, -14).Should().Be(DayOfWeek.Friday);
            TimeTool.AddDays(DayOfWeek.Saturday, -14).Should().Be(DayOfWeek.Saturday);
            TimeTool.AddDays(DayOfWeek.Sunday, -14).Should().Be(DayOfWeek.Sunday);
        }