public void TestAppendNegativeInteger()
        {
            StringBuilder builder = new StringBuilder();

            StringBuilderHelper.Append(builder, -12345);

            Assert.AreEqual("-12345", builder.ToString());
        }
        public void TestAppendByte()
        {
            StringBuilder builder = new StringBuilder();

            StringBuilderHelper.Append(builder, (byte)255);

            Assert.AreEqual("255", builder.ToString());
        }
        public void TestAppendNullInteger()
        {
            StringBuilder builder = new StringBuilder();

            StringBuilderHelper.Append(builder, 0);

            Assert.AreEqual("0", builder.ToString());
        }
        public void TestAppendDoubleWithoutDecimalPlaces()
        {
            StringBuilder builder = new StringBuilder();

            StringBuilderHelper.Append(builder, 0.00390625, 0);

            Assert.AreEqual("0", builder.ToString());
        }
        public void TestAppendHugeDouble()
        {
            StringBuilder builder = new StringBuilder();

            StringBuilderHelper.Append(builder, 1000000000000000000.0);

            Assert.AreEqual("1000000000000000000.0", builder.ToString());
        }
        public void TestAppendDoubleLimitDecimalPlaces()
        {
            StringBuilder builder = new StringBuilder();

            StringBuilderHelper.Append(builder, 0.00390625, 3);

            Assert.AreEqual("0.003", builder.ToString()); // Note: no rounding!
        }
        public void TestAppendPositiveDouble()
        {
            StringBuilder builder = new StringBuilder();

            StringBuilderHelper.Append(builder, 10.0625);

            Assert.AreEqual("10.0625", builder.ToString());
        }
        public void TestAppendSmallDouble()
        {
            StringBuilder builder = new StringBuilder();

            StringBuilderHelper.Append(builder, 0.00390625);

            Assert.AreEqual("0.00390625", builder.ToString());
        }
        public void TestAppendNegativeDouble()
        {
            StringBuilder builder = new StringBuilder();

            StringBuilderHelper.Append(builder, -32.015625);

            Assert.AreEqual("-32.015625", builder.ToString());
        }
        public void TestAppendFloatWithoutDecimalPlaces()
        {
            StringBuilder builder = new StringBuilder();

            StringBuilderHelper.Append(builder, 0.00390625f, 0);

            Assert.AreEqual("0", builder.ToString()); // Note: no rounding!
        }
        public void TestAppendFloatLimitDecimalPlaces()
        {
            StringBuilder builder = new StringBuilder();

            StringBuilderHelper.Append(builder, 0.00390625f, 3);

            Assert.AreEqual("0.003", builder.ToString());
        }
        public void TestAppendPositiveLong()
        {
            StringBuilder builder = new StringBuilder();

            StringBuilderHelper.Append(builder, 12345L);

            Assert.AreEqual("12345", builder.ToString());
        }
        public void TestAppendOutOfRangeFloat()
        {
            StringBuilder builder = new StringBuilder();

            Assert.IsFalse(StringBuilderHelper.Append(builder, float.PositiveInfinity));
            Assert.IsFalse(StringBuilderHelper.Append(builder, float.NegativeInfinity));
            Assert.IsFalse(StringBuilderHelper.Append(builder, float.NaN));
            Assert.IsFalse(StringBuilderHelper.Append(builder, 0.000000059604644775390625f));
        }
        public void TestAppendOutOfRangeDouble()
        {
            StringBuilder builder = new StringBuilder();

            Assert.IsFalse(StringBuilderHelper.Append(builder, double.PositiveInfinity));
            Assert.IsFalse(StringBuilderHelper.Append(builder, double.NegativeInfinity));
            Assert.IsFalse(StringBuilderHelper.Append(builder, double.NaN));
            Assert.IsFalse(
                StringBuilderHelper.Append(builder, 1.1102230246251565404236316680908e-16)
                );
        }