package txt

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestTitle(t *testing.T) {
	t.Run("CourDHonneur", func(t *testing.T) {
		assert.Equal(t, "Cour d'Honneur", Title("Cour d'Honneur"))
	})
	t.Run("DucsDeLaForce", func(t *testing.T) {
		assert.Equal(t, "Ducs de la Force", Title("Ducs de La Force"))
	})
	t.Run("DucsDeLaForce", func(t *testing.T) {
		assert.Equal(t, "Ducs de la Force", Title("ducs de la force"))
	})
	t.Run("Broglie", func(t *testing.T) {
		assert.Equal(t, "Broglie, des Cars", Title("broglie, des cars"))
	})
	t.Run("LeDeFrance", func(t *testing.T) {
		assert.Equal(t, "Île-de-France", Title("Île-de-France"))
	})
	t.Run("IleDeFrance", func(t *testing.T) {
		assert.Equal(t, "Île-de-France", Title("ile-de-France"))
	})
	t.Run("BrowseYourLife", func(t *testing.T) {
		assert.Equal(t, "Browse Your Life in Pictures", Title("Browse your life in pictures"))
	})
	t.Run("German", func(t *testing.T) {
		assert.Equal(t, "Die Burg von oben gesehen.", Title("die burg von oben gesehen."))
		assert.Equal(t, "Die Katze ist auf dem Dach für viele nicht sichtbar!", Title("die katze ist auf dem dach für viele nicht sichtbar!"))
	})
	t.Run("PhotoLover", func(t *testing.T) {
		assert.Equal(t, "Photo-Lover", Title("photo-lover"))
	})
	t.Run("NaomiWatts", func(t *testing.T) {
		assert.Equal(t, "Naomi Watts / Ewan McGregor / The Impossible / TIFF", Title(" /Naomi watts / Ewan Mcgregor / the   Impossible /   TIFF  "))
	})
	t.Run("Penguin", func(t *testing.T) {
		assert.Equal(t, "A Boulders Penguin Colony / Simon's Town / 2013", Title("A Boulders Penguin Colony /// Simon's Town / 2013 "))
	})
	t.Run("AirportBer", func(t *testing.T) {
		assert.Equal(t, "Around the Terminal / Airport BER", Title("Around  the Terminal  / Airport Ber"))
	})
	t.Run("KwaZuluNatal", func(t *testing.T) {
		assert.Equal(t, "KwaZulu-Natal", Title("KwaZulu-Natal"))
	})
	t.Run("TestAddLabel", func(t *testing.T) {
		assert.Equal(t, "TestAddLabel", Title("testAddLabel"))
	})
	t.Run("PhotoPrism", func(t *testing.T) {
		assert.Equal(t, "PhotoPrism", Title("photoprism"))
	})
	t.Run("Youtube", func(t *testing.T) {
		assert.Equal(t, "YouTube", Title("youtube"))
	})
	t.Run("InterpunctionOne", func(t *testing.T) {
		assert.Equal(t, "This,,, Is !a ! a Very Strange Title....", Title("this,,, is !a ! a very strange title...."))
	})
	t.Run("InterpunctionTwo", func(t *testing.T) {
		assert.Equal(t, "This Is a Not So Strange Title!", Title("This is a not so strange title!"))
	})
	t.Run("Horse", func(t *testing.T) {
		assert.Equal(t, "A Horse Is Not a Cow :-)", Title("a horse is not a cow :-)"))
	})
	t.Run("NewYears", func(t *testing.T) {
		assert.Equal(t, "Boston New Year's", Title("boston new year's"))
	})
	t.Run("Empty", func(t *testing.T) {
		assert.Empty(t, Title(""))
	})
	t.Run("NYC", func(t *testing.T) {
		assert.Equal(t, "NYC, NY - LonDon, UK - NYC, NY and London, UK.", Title("NYC, NY - LonDon, UK - Nyc, Ny and London, Uk."))
	})
	t.Run("KoosVanDriemond", func(t *testing.T) {
		assert.Equal(t, "Koos van Driemond", Title("Koos van Driemond"))
	})
	t.Run("NonCommercialPics", func(t *testing.T) {
		assert.Equal(t, "Non Commercial Pics", Title("Non Commercial Pics"))
	})
	t.Run("ImgNonCommercialPics", func(t *testing.T) {
		assert.Equal(t, "Non Commercial Pics", FileTitle("Img Non Commercial Pics"))
	})
	t.Run("TikTokZDF", func(t *testing.T) {
		assert.Equal(t, "eBay Is Not TikTok! / ARD & ZDF", Title("ebay is not tiktok! / ard & zdf"))
	})
	t.Run("Arabic", func(t *testing.T) {
		assert.Equal(t, "عَمَّان", Title("عَمَّان"))
		assert.Equal(t, "Deir Ez-Zor", Title("deir ez-zor"))
		assert.Equal(t, "Al-Hasakah", Title("al-hasakah"))
		assert.Equal(t, "Tel Al-Sultan", Title("tel al-sultan"))
		assert.Equal(t, "Al Qunaytirah", Title("al qunaytirah"))
		assert.Equal(t, "In Al Qunaytirah", Title("in al qunaytirah"))
	})
}
