package be.seeseepuff.allowanceplanner;

import be.seeseepuff.allowanceplanner.util.ColourUtil;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

class ColourUtilTest {
    @Test
    void convertStringToColourWithSign() {
        assertEquals(0x123456, ColourUtil.convertStringToColour("#123456"));
    }

    @Test
    void convertStringToColourWithoutSign() {
        assertEquals(0x123456, ColourUtil.convertStringToColour("123456"));
    }

    @Test
    void convertStringToColourWithSignThreeDigits() {
        assertEquals(0xA0B0C0, ColourUtil.convertStringToColour("#ABC"));
    }

    @Test
    void convertStringToColourWithoutSignThreeDigits() {
        assertEquals(0xA0B0C0, ColourUtil.convertStringToColour("ABC"));
    }
}
