Example #1
0
        public void should_throw_when_destination_buffer_is_too_small()
        {
            var src = new Buffer(new byte[] { 0, 1, 2, 3, 4 });
            var dest = new Buffer(2);

            Assert.Throws<ArgumentException>(() => src.CopyTo(ref dest));
        }
Example #2
0
        public void should_throw_when_destination_buffer_is_too_small()
        {
            var src  = new Buffer(new byte[] { 0, 1, 2, 3, 4 });
            var dest = new Buffer(2);

            Assert.Throws <ArgumentException>(() => src.CopyTo(ref dest));
        }
Example #3
0
        public void should_copy_to_buffer()
        {
            var src = new Buffer(new byte[] { 0, 1, 2, 3, 4 });
            var dest = new Buffer(10);

            src.CopyTo(ref dest);

            dest.Length.ShouldEqual(src.Length);
            dest.Data.Take(dest.Length).ShouldEqual(src.Data.Take(src.Length));
        }
Example #4
0
        public void should_copy_to_buffer()
        {
            var src  = new Buffer(new byte[] { 0, 1, 2, 3, 4 });
            var dest = new Buffer(10);

            src.CopyTo(ref dest);

            dest.Length.ShouldEqual(src.Length);
            dest.Data.Take(dest.Length).ShouldEqual(src.Data.Take(src.Length));
        }