forked from codebude/QRCoder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXamlQRCodeRendererTests.cs
45 lines (38 loc) · 1.19 KB
/
XamlQRCodeRendererTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#if TEST_XAML
using QRCoder;
using QRCoder.Xaml;
using QRCoderTests.Helpers;
using Shouldly;
using Xunit;
namespace QRCoderTests;
public class XamlQRCodeRendererTests
{
[Fact]
public void can_create_xaml_qrcode_standard_graphic()
{
var gen = new QRCodeGenerator();
var data = gen.CreateQrCode("This is a quick test! 123#?", QRCodeGenerator.ECCLevel.H);
var xCode = new XamlQRCode(data).GetGraphic(10);
var bmp = HelperFunctions.BitmapSourceToBitmap(xCode);
var result = HelperFunctions.BitmapToHash(bmp);
result.ShouldBe("f2ed5073bd42dc012e442c0f750e9dae");
}
[Fact]
public void can_instantate_qrcode_parameterless()
{
var svgCode = new XamlQRCode();
svgCode.ShouldNotBeNull();
svgCode.ShouldBeOfType<XamlQRCode>();
}
/*
[Fact]
public void can_render_qrcode_from_helper()
{
//Create QR code
var bmp = QRCodeHelper.GetQRCode("This is a quick test! 123#?", 10, Color.Black, Color.White, QRCodeGenerator.ECCLevel.H);
var result = HelperFunctions.BitmapToHash(bmp);
result.ShouldBe("e8c61b8f0455924fe08ba68686d0d296");
}
*/
}
#endif