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

InsertAt_Invalid_Throws() private method

private InsertAt_Invalid_Throws ( ) : void
return void
        public static void InsertAt_Invalid_Throws()
        {
            using (SecureString testString = CreateSecureString("bd"))
            {
                Assert.Throws<ArgumentOutOfRangeException>("index", () => testString.InsertAt(-1, 'S'));
                Assert.Throws<ArgumentOutOfRangeException>("index", () => testString.InsertAt(6, 'S'));
            }

            using (SecureString testString = CreateSecureString(CreateString(ushort.MaxValue + 1)))
            {
                Assert.Throws<ArgumentOutOfRangeException>("capacity", () => testString.InsertAt(22, 'S'));
            }
        }