package branding

import (
	"testing"
)

func TestResolveName(t *testing.T) {
	cases := []struct {
		name     string
		env      string
		envSet   bool
		expected string
	}{
		{"unset → default HLC", "", false, "HLC"},
		{"empty string → default HLC", "", true, "HLC"},
		{"whitespace only → default HLC", "   ", true, "HLC"},
		{"override applied", "Acme Patents", true, "Acme Patents"},
		{"override trimmed", "  Acme  ", true, "Acme"},
	}
	for _, tc := range cases {
		t.Run(tc.name, func(t *testing.T) {
			if tc.envSet {
				t.Setenv("FIRM_NAME", tc.env)
			} else {
				t.Setenv("FIRM_NAME", "")
			}
			if got := resolveName(); got != tc.expected {
				t.Errorf("resolveName() = %q, want %q", got, tc.expected)
			}
		})
	}
}
