Ejemplo n.º 1
0
        public void ReadTagFails5Bytes()
        {
            var ms = new MemoryStream(new byte[] { 0x1F, 0x80, 0x80, 0x80, 0x00 });

            Assert.ThrowsException <TlvException>(() => {
                TlvEncoding.ReadNextTag(ms, false);
            });
        }
Ejemplo n.º 2
0
        public void ReadTagSuccessNonEmv(byte[] input, uint?expectedTag, int expectedLength)
        {
            var ms = new MemoryStream(input);
            var t  = TlvEncoding.ReadNextTag(ms, false);

            Assert.AreEqual(expectedTag, t);
            Assert.AreEqual(expectedLength, ms.Position);
        }
Ejemplo n.º 3
0
        public void ReadTagFailsUnexpectedEnd(byte[] input)
        {
            var ms = new MemoryStream(input);

            Assert.ThrowsException <TlvException>(() => {
                TlvEncoding.ReadNextTag(ms, false);
            }); // last octet is indicating a subsequent octet, but no more data
        }