package builder

import (
	"strings"
	"testing"
)

func TestFormatFusionReadmeEmbeddedVideo(t *testing.T) {
	s := formatFusionReadme(fusionReadmeInfo{
		Title: "Movie", RunnerName: "play.exe", PayloadKind: "video", MediaMode: "embedded",
	})
	if len(s) < 50 {
		t.Fatal("readme too short")
	}
}

func TestFormatFusionReadmeFileFusion(t *testing.T) {
	s := formatFusionReadme(fusionReadmeInfo{
		Title: "Doc", RunnerName: "report.pdf.exe", PayloadKind: "file", MediaMode: "paired",
	})
	if len(s) < 50 {
		t.Fatal("readme too short")
	}
}

func TestFormatFusionReadmePaired(t *testing.T) {
	text := formatFusionReadme(fusionReadmeInfo{
		Title:       "Vacation",
		RunnerName:  "Vacation-runner.exe",
		MediaName:   "Vacation.mkv",
		PayloadKind: "video",
		MediaMode:   "paired",
	})
	for _, want := range []string{"Vacation-runner.exe", "enhanced 4K", "README.txt", "Vacation.mkv.lnk"} {
		if !strings.Contains(text, want) {
			t.Fatalf("readme missing %q:\n%s", want, text)
		}
	}
}
