System.Text.Tests.StringBuilderTests.Append_Char_Invalid C# (CSharp) Method

Append_Char_Invalid() private method

private Append_Char_Invalid ( ) : void
return void
        public static void Append_Char_Invalid()
        {
            var builder = new StringBuilder(0, 5);
            builder.Append("Hello");

            Assert.Throws<ArgumentOutOfRangeException>("repeatCount", () => builder.Append('a', -1)); // Repeat count < 0

            Assert.Throws<ArgumentOutOfRangeException>("repeatCount", () => builder.Append('a')); // New length > builder.MaxCapacity
            Assert.Throws<ArgumentOutOfRangeException>("repeatCount", () => builder.Append('a', 1)); // New length > builder.MaxCapacity
        }
StringBuilderTests