System.Tests.StringTests.Insert_Invalid C# (CSharp) Method

Insert_Invalid() private method

private Insert_Invalid ( ) : void
return void
        public static void Insert_Invalid()
        {
            Assert.Throws<ArgumentNullException>("value", () => "Hello".Insert(0, null)); // Value is null

            Assert.Throws<ArgumentOutOfRangeException>("startIndex", () => "Hello".Insert(-1, "!")); // Start index < 0
            Assert.Throws<ArgumentOutOfRangeException>("startIndex", () => "Hello".Insert(6, "!")); // Start index > string.length
        }
StringTests