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

Append_Decimal_NoSpareCapacity_ThrowsArgumentOutOfRangeException() private method

        public static void Append_Decimal_NoSpareCapacity_ThrowsArgumentOutOfRangeException()
        {
            var builder = new StringBuilder(0, 5);
            builder.Append("Hello");

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