System.IO.Tests.MemoryStreamTests.CopyTo C# (CSharp) Метод

CopyTo() приватный Метод

private CopyTo ( Stream source, byte expected ) : void
source Stream
expected byte
Результат void
        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());
            }
        }