Beispiel #1
0
        public void TestDefault()
        {
            var barcode = new ITF
            {
                EncodeThis = "1234567890"
            };

            var payload = barcode.Build();

            Assert.NotNull(payload);
            Assert.IsNotEmpty(payload);

            var expected = new byte[]
            {
                0x1D, 0x68, 0x64,   // BarcodeDotHeight
                0x1D, 0x77, 0x02,   // BarcodeWidthMultiplier
                0x1D, 0x48, 0x00,   // HRI Position
                0x1D, 0x66, 0x00,   // BarcodeFont
                0x1D, 0x6B, 0x05,   // ITF Form 1
                (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', (byte)'6',
                (byte)'7', (byte)'8', (byte)'9', (byte)'0', (byte)'\0',
            };

            Assert.AreEqual(expected, payload);
        }
Beispiel #2
0
        public void TestNonDigit()
        {
            var barcode = new ITF
            {
                EncodeThis = "i'mastring"
            };

            var payload = barcode.Build();

            Assert.NotNull(payload);
            Assert.IsEmpty(payload);
        }
Beispiel #3
0
        public void TestOddLen()
        {
            var barcode = new ITF
            {
                EncodeThis = "123"
            };

            var payload = barcode.Build();

            Assert.NotNull(payload);
            Assert.IsEmpty(payload);
        }