Exemplo n.º 1
0
        public void can_render_pngbyte_qrcode_from_helper_2()
        {
            //Create QR code
            var pngCodeGfx = PngByteQRCodeHelper.GetQRCode("This is a quick test! 123#?", 5, new byte[] { 255, 255, 255, 127 }, new byte[] { 0, 0, 255 }, QRCodeGenerator.ECCLevel.L);

#if NETCOREAPP1_1
            var result = HelperFunctions.ByteArrayToHash(pngCodeGfx);
            result.ShouldBe("627ce564fb5e17be42e4a85e907a17b5");
#else
            using (var mStream = new MemoryStream(pngCodeGfx))
            {
                var bmp    = (Bitmap)Image.FromStream(mStream);
                var result = HelperFunctions.BitmapToHash(bmp);
                result.ShouldBe("c56c2a9535fd8e9a92a6ac9709d21e67");
            }
#endif
        }
Exemplo n.º 2
0
        public void can_render_pngbyte_qrcode_from_helper()
        {
            //Create QR code
            var pngCodeGfx = PngByteQRCodeHelper.GetQRCode("This is a quick test! 123#?", QRCodeGenerator.ECCLevel.L, 10);

#if NETCOREAPP1_1
            var result = HelperFunctions.ByteArrayToHash(pngCodeGfx);
            result.ShouldBe("c562388f4f3cf13a299b469a3e3b852f");
#else
            using (var mStream = new MemoryStream(pngCodeGfx))
            {
                var bmp    = (Bitmap)Image.FromStream(mStream);
                var result = HelperFunctions.BitmapToHash(bmp);
                result.ShouldBe("1978fb11ce26acf9b6cb7490b4c44ef2");
            }
#endif
        }