AK.F1.Timing.Server.IO.ByteBufferSnapshotTest.can_copy_snapshot_data C# (CSharp) Метод

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

private can_copy_snapshot_data ( ) : void
Результат void
        public void can_copy_snapshot_data()
        {
            var actual = new byte[10];
            var snapshot = Create(10, 0, 10);

            snapshot.CopyTo(0, actual, 0, actual.Length);
            Assert.Equal(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, actual);
            // count
            actual = new byte[10];
            snapshot.CopyTo(0, actual, 0, 5);
            Assert.Equal(new byte[] { 1, 2, 3, 4, 5, 0, 0, 0, 0, 0 }, actual);
            // dstOffset
            actual = new byte[10];
            snapshot.CopyTo(0, actual, 5, 5);
            Assert.Equal(new byte[] { 0, 0, 0, 0, 0, 1, 2, 3, 4, 5 }, actual);
            // srcOffset
            actual = new byte[10];
            snapshot.CopyTo(5, actual, 0, 5);
            Assert.Equal(new byte[] { 6, 7, 8, 9, 10, 0, 0, 0, 0, 0 }, actual);
            // internal offset
            actual = new byte[10];
            snapshot = Create(10, 5, 5);
            snapshot.CopyTo(0, actual, 0, 5);
            Assert.Equal(new byte[] { 6, 7, 8, 9, 10, 0, 0, 0, 0, 0 }, actual);
        }