System.Security.Tests.SecureStringTests.Ctor_CharInt_Invalid C# (CSharp) Method

Ctor_CharInt_Invalid() private method

private Ctor_CharInt_Invalid ( ) : void
return void
        public static unsafe void Ctor_CharInt_Invalid()
        {
            Assert.Throws<ArgumentNullException>("value", () => new SecureString(null, 0));
            Assert.Throws<ArgumentOutOfRangeException>("length", () => { fixed (char* chars = "test") new SecureString(chars, -1); });
            Assert.Throws<ArgumentOutOfRangeException>("length", () => CreateSecureString(CreateString(ushort.MaxValue + 2 /*65537: Max allowed length is 65536*/)));
        }