Skip to content

Commit 3325a16

Browse files
committed
Fixed test case for byte-array data
1 parent e671274 commit 3325a16

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

QRCoderTests/QRGeneratorTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,11 @@ public void can_encode_byte()
127127
[Category("QRGenerator/TextEncoding")]
128128
public void can_generate_from_bytes()
129129
{
130+
byte[] test_data = { 49, 50, 51, 65, 66, 67 }; //123ABC
130131
var gen = new QRCodeGenerator();
131-
var qrData = gen.CreateQrCode(Encoding.UTF8.GetBytes("123ABC"), QRCodeGenerator.ECCLevel.L);
132+
var qrData = gen.CreateQrCode(test_data, QRCodeGenerator.ECCLevel.L);
132133
var result = string.Join("", qrData.ModuleMatrix.Select(x => x.ToBitString()).ToArray());
133-
result.ShouldBe("0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111010111011111110000000010000010001100100000100000000101110101101001011101000000001011101011001010111010000000010111010100100101110100000000100000100111101000001000000001111111010101011111110000000000000000000110000000000000000111100101111110011101000000000111100010011110001110000000000100010100100000001000000000011110011111001110011000000001111101110101001000000000000000000000111100100100100000000111111100001100100110000000001000001000100001111110000000010111010010011111010100000000101110101111001011110000000001011101010101011000000000000010000010111001000010000000000111111101010010010010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
134+
result.ShouldBe("0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111011001011111110000000010000010010010100000100000000101110101010101011101000000001011101010010010111010000000010111010111000101110100000000100000100000001000001000000001111111010101011111110000000000000000011000000000000000000111100101010010011101000000001011100001001001001110000000010101011111011111110100000000000101000000110000000000000001011001001010100110000000000000000000110001000101000000000111111100110011011110000000001000001001111110111010000000010111010011100100101100000000101110101110010010010000000001011101011010100011000000000010000010110110101000100000000111111101011100010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
134135
}
135136
}
136137

0 commit comments

Comments
 (0)