public void ByteArrayToBitmap_Should_Handle_ValidObject()
        {
            var bytes = ImageConverterHelper.BitmapToByteArray(Resources.ClearWindowContent_16x_Gray, ImageFormat.Png);
            var ret   = ImageConverterHelper.ByteArrayToBitmap(bytes);

            Assert.NotNull(ret);
            Assert.Equal(16, ret.Width);
            Assert.Equal(16, ret.Height);
        }
        public static BitmapSource CreateBitmapSource(byte[] img)
        {
            if (img is null || img.Length == 0)
            {
                return(null);
            }

            var image = ImageConverterHelper.ByteArrayToBitmap(img);

            return(CreateBitmapSource(image));
        }
 public void ByteArrayToBitmap_Should_Handle_EmptyArray()
 {
     Assert.Throws <ArgumentException>(() =>
                                       ImageConverterHelper.ByteArrayToBitmap(new byte[0]));
 }
 public void ByteArrayToBitmap_Should_Handle_Null()
 {
     Assert.Throws <ArgumentNullException>(() =>
                                           ImageConverterHelper.ByteArrayToBitmap(null));
 }