package main

import (
	"github.com/stretchr/testify/require"
	"testing"
)

func TestConvertStringToColourWithSign(t *testing.T) {
	colour, err := ConvertStringToColour("#123456")
	require.NoError(t, err)
	require.Equal(t, 0x123456, colour)
}

func TestConvertStringToColourWithoutSign(t *testing.T) {
	colour, err := ConvertStringToColour("123456")
	require.NoError(t, err)
	require.Equal(t, 0x123456, colour)
}

func TestConvertStringToColourWithSignThreeDigits(t *testing.T) {
	colour, err := ConvertStringToColour("#ABC")
	require.NoError(t, err)
	require.Equal(t, 0xA0B0C0, colour)
}

func TestConvertStringToColourWithoutSignThreeDigits(t *testing.T) {
	colour, err := ConvertStringToColour("ABC")
	require.NoError(t, err)
	require.Equal(t, 0xA0B0C0, colour)
}
