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)); }
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)); }
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)); }