public void testUnpack() throws Exception { byte[] raw = new byte[] {(byte)0x30, (byte)0x34, (byte)0xF1, (byte)0xF2, (byte)0xF3, (byte)0xF4}; IFAE_LLCHAR packager = new IFAE_LLCHAR(10, "Should be 041234"); ISOField field = new ISOField(12); packager.unpack(field, raw, 0); assertEquals("1234", (String) field.getValue()); }
public void testUnpackWithPackagerWithoutDescription() throws Exception { byte[] raw = new byte[] {(byte)0x30, (byte)0x34, (byte)0xF1, (byte)0xF2, (byte)0xF3, (byte)0xF4}; IFAE_LLCHAR packager = new IFAE_LLCHAR(); packager.setLength(10); ISOField field = new ISOField(12); packager.unpack(field, raw, 0); assertEquals("1234", (String) field.getValue()); }
public void testReversability() throws Exception { String origin = "Abc123:.-"; ISOField field = new ISOField(12, origin); IFAE_LLCHAR packager = new IFAE_LLCHAR(10, "Should be Abc123:.-"); ISOField unpack = new ISOField(12); packager.unpack(unpack, packager.pack(field), 0); assertEquals(origin, (String) unpack.getValue()); }