System.Tests.DateTimeTests.Ctor_Long_DateTimeKind_Invalid C# (CSharp) Method

Ctor_Long_DateTimeKind_Invalid() private method

private Ctor_Long_DateTimeKind_Invalid ( ) : void
return void
        public static void Ctor_Long_DateTimeKind_Invalid()
        {
            Assert.Throws<ArgumentOutOfRangeException>("ticks", () => new DateTime(DateTime.MinValue.Ticks - 1, DateTimeKind.Utc)); // Ticks < DateTime.MinValue.Ticks
            Assert.Throws<ArgumentOutOfRangeException>("ticks", () => new DateTime(DateTime.MaxValue.Ticks + 1, DateTimeKind.Utc)); // Ticks > DateTime.MaxValue.Ticks

            Assert.Throws<ArgumentException>("kind", () => new DateTime(0, DateTimeKind.Unspecified - 1)); // Invalid date time kind
            Assert.Throws<ArgumentException>("kind", () => new DateTime(0, DateTimeKind.Local + 1)); // Invalid date time kind
        }
DateTimeTests