public void CopyTo(Stream source, byte[] expected)
{
using (var destination = new MemoryStream())
{
source.CopyTo(destination);
Assert.InRange(source.Position, source.Length, int.MaxValue); // Copying the data should have read to the end of the stream or stayed past the end.
Assert.Equal(expected, destination.ToArray());
}
}