/*
 * @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 FormatHexTest {

    @Test
    public void testFormatBuilder() {
        assertEquals("0x34", FormatHex.format(new StringBuilder("0x"), (byte)0x34).toString());
        assertEquals("0x97", FormatHex.format(new StringBuilder("0x"), (byte)0x97).toString());
        assertEquals("H:34 97", FormatHex.format(new StringBuilder("H:"), new byte[]{(byte)0x34, (byte)0x97}).toString());
    }
    
    @Test
    public void testFormat() {
        assertEquals("34", FormatHex.format((byte)0x34));
        assertEquals("97", FormatHex.format((byte)0x97));
        assertEquals("34 97", FormatHex.format(new byte[]{(byte)0x34, (byte)0x97}));
    }
    
}
