package award

import "testing"

func TestUSCountyKey(t *testing.T) {
	cases := []struct {
		state, cnty, want string
	}{
		{"MA", "MA,MIDDLESEX", "MA/MIDDLESEX"},        // LoTW "ST,County" shape
		{"NJ", "Middlesex", "NJ/MIDDLESEX"},           // bare name + state column
		{"TX", "Montgomery", "TX/MONTGOMERY"},         // title case
		{"FL", "Saint Lucie", "FL/STLUCIE"},           // Saint→St, space dropped
		{"FL", "St. Lucie", "FL/STLUCIE"},             // FIPS abbreviation, period dropped
		{"AK", "Matanuska-Susitna", "AK/MATANUSKASUSITNA"}, // hyphen→space→dropped
		{"IL", "De Kalb", "IL/DEKALB"},                // split name
		{"IL", "DeKalb County", "IL/DEKALB"},          // suffix + one word
		{"LA", "Acadia Parish", "LA/ACADIA"},          // parish suffix
		{"", "Honolulu", ""},                          // no state → no match
		{"HI", "0", ""},                               // garbage
		{"HI", "", ""},                                // empty
	}
	for _, c := range cases {
		if got := USCountyKey(c.state, c.cnty); got != c.want {
			t.Errorf("USCountyKey(%q,%q) = %q, want %q", c.state, c.cnty, got, c.want)
		}
	}
}
