public void testPack() throws Exception { ISOField field = new ISOField(12, "1234"); IFAE_LLCHAR packager = new IFAE_LLCHAR(10, "Should be 041234"); TestUtils.assertEquals(new byte[] {(byte)0x30, (byte)0x34, (byte)0xF1, (byte)0xF2, (byte)0xF3, (byte)0xF4}, packager.pack(field)); }
public void testPackWithPackagerWithoutDescription() throws Exception { ISOField field = new ISOField(12, "1234"); IFAE_LLCHAR packager = new IFAE_LLCHAR(); packager.setLength(12); TestUtils.assertEquals(new byte[] {(byte)0x30, (byte)0x34, (byte)0xF1, (byte)0xF2, (byte)0xF3, (byte)0xF4}, packager.pack(field)); }
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()); }