public void CopyToUshortBuffer_ShouldReturnUshortArray_When_BufferSizeIsLargeEnough() { var imageFrame = new ImageFrame(ImageFormat.Format.GRAY16, 10, 10); var normalBuffer = imageFrame.CopyToUshortBuffer(100); var largeBuffer = imageFrame.CopyToUshortBuffer(120); Assert.IsEmpty(normalBuffer.Where((x, i) => x != largeBuffer[i])); }
public void CopyToUshortBuffer_ShouldThrowException_When_BufferSizeIsTooSmall() { var imageFrame = new ImageFrame(ImageFormat.Format.GRAY16, 10, 10); Assert.Throws <MediaPipeException>(() => { imageFrame.CopyToUshortBuffer(99); }); }