/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira
 */
package net.ranides.assira.text;

import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public class StringEncoderTest {
    
    public StringEncoderTest() {
    }
    
    @Test
    public void testBytesToHex() {
        byte[] input = new byte[]{ 0x41, 0x47, 0x63, (byte)0xA3, (byte)0xFF, (byte)0xC2 };
        assertEquals("41 47 63 A3 FF C2", StringEncoder.bytesToHex(input, " "));
    }

    @Test
    public void testSomeMethod() {
        byte[] expected = new byte[]{ 0x41, 0x47, 0x63, (byte)0xA3, (byte)0xFF, (byte)0xC2 };
        
        assertArrayEquals(expected, StringEncoder.hexToBytes("414763A3FFC2"));
    }
    
}
