public void Copy_WritesContent_IfTargetTextWriterIsNotAStringCollectionTextWriter()
        {
            // Arrange
            var source   = new StringCollectionTextWriter(Encoding.UTF8);
            var target   = new StringWriter();
            var expected = @"Hello world" + Environment.NewLine + "abc";

            // Act
            source.WriteLine("Hello world");
            source.Write(new[] { 'x', 'a', 'b', 'c' }, 1, 3);
            source.CopyTo(target, new CommonTestEncoder());

            // Assert
            Assert.Equal(expected, target.ToString());
        }
        public void Copy_CopiesContent_IfTargetTextWriterIsAStringCollectionTextWriter()
        {
            // Arrange
            var source = new StringCollectionTextWriter(Encoding.UTF8);
            var target = new StringCollectionTextWriter(Encoding.UTF8);

            // Act
            source.Write("Hello world");
            source.Write(new char[1], 0, 1);
            source.CopyTo(target, new CommonTestEncoder());

            // Assert
            // Make sure content was written to the source.
            Assert.Equal(2, source.Entries.Count);
            Assert.Equal(1, target.Entries.Count);

            var entry = Assert.Single(target.Entries);

            Assert.Same(source.Content, entry);
        }