System.Tests.DateTimeTests.Ctor_Int_Int_Int_Invalid C# (CSharp) Метод

Ctor_Int_Int_Int_Invalid() приватный Метод

private Ctor_Int_Int_Int_Invalid ( ) : void
Результат void
        public static void Ctor_Int_Int_Int_Invalid()
        {
            Assert.Throws<ArgumentOutOfRangeException>(null, () => new DateTime(0, 1, 1)); // Year < 0
            Assert.Throws<ArgumentOutOfRangeException>(null, () => new DateTime(10000, 1, 1)); // Year > 9999

            Assert.Throws<ArgumentOutOfRangeException>(null, () => new DateTime(1, 0, 1)); // Month < 1
            Assert.Throws<ArgumentOutOfRangeException>(null, () => new DateTime(1, 13, 1)); // Month > 12

            Assert.Throws<ArgumentOutOfRangeException>(null, () => new DateTime(1, 1, 0)); // Day < 1
            Assert.Throws<ArgumentOutOfRangeException>(null, () => new DateTime(1, 1, 32)); // Day > days in month
        }
DateTimeTests