public void StringSegment_StringBuilder_Append_StringSegment3()
        {
            var sb = new StringBuilder();

            Assert.AreSame(sb, sb.Append("foo"));
            Assert.AreSame(sb, StringBuilderStringSegmentExtensions.Append(sb, new StringSegment("zzz", 1, 0)));
            Assert.AreSame(sb, sb.Append("qux"));

            Assert.AreEqual("fooqux", sb.ToString());
        }
        public void StringSegment_StringBuilder_Append_StringSegment_Int32_Int32_ArgumentChecking()
        {
            var sb  = new StringBuilder();
            var bar = new StringSegment("bar");

            Assert.ThrowsException <ArgumentNullException>(() => StringBuilderStringSegmentExtensions.Append(builder: null, bar, 0, 1));

            Assert.ThrowsException <ArgumentOutOfRangeException>(() => StringBuilderStringSegmentExtensions.Append(sb, bar, -1, 1));
            Assert.ThrowsException <ArgumentOutOfRangeException>(() => StringBuilderStringSegmentExtensions.Append(sb, bar, 0, -1));
            Assert.ThrowsException <ArgumentOutOfRangeException>(() => StringBuilderStringSegmentExtensions.Append(sb, bar, 3, 1));
            Assert.ThrowsException <ArgumentOutOfRangeException>(() => StringBuilderStringSegmentExtensions.Append(sb, bar, 0, 4));

            Assert.ThrowsException <ArgumentNullException>(() => StringBuilderStringSegmentExtensions.Append(sb, default, 0, 1));
        public void StringSegment_StringBuilder_Append_StringSegment_ArgumentChecking()
        {
            var bar = new StringSegment("bar");

            Assert.ThrowsException <ArgumentNullException>(() => StringBuilderStringSegmentExtensions.Append(builder: null, bar));
        }