GetYearOf() public static method

public static GetYearOf ( int yearBaseMonth, int year, int month ) : int
yearBaseMonth int
year int
month int
return int
Beispiel #1
0
        public void GetYearOfTest()
        {
            TimeTool.GetYearOf(new DateTime(2000, 1, 1), 1).Should().Be(2000);
            TimeTool.GetYearOf(new DateTime(2000, 4, 1), 4).Should().Be(2000);
            TimeTool.GetYearOf(new DateTime(2000, 3, 31), 4).Should().Be(1999);
            TimeTool.GetYearOf(new DateTime(2000, 1, 1), 4).Should().Be(1999);

            TimeTool.GetYearOf(nowTime, 1).Should().Be(nowTime.Year);
        }