package fees import "testing" func TestCalculateFee(t *testing.T) { t.Parallel() // All expected outputs verified against live Python implementation on 2026-05-06: // PYTHONPATH=scripts:. python -c 'from attendance import calculate_fee; print([calculate_fee(c,m) for c,m in [(0,"2026-05"),(0,""),(1,"2026-05"),(1,"unknown"),(2,"2026-05"),(2,"2026-03"),(2,"2025-09"),(5,"2026-05"),(2,"2027-01"),(2,"")]])' tests := []struct { name string count int month string want int }{ {"zero short-circuits", 0, "2026-05", 0}, {"zero empty month", 0, "", 0}, {"single practice", 1, "2026-05", 200}, {"single ignores monthKey", 1, "unknown", 200}, {"two practices configured month", 2, "2026-05", 700}, {"two practices reduced march", 2, "2026-03", 350}, {"two practices early season", 2, "2025-09", 750}, {"high count same as two", 5, "2026-05", 700}, {"unknown future month falls back", 2, "2027-01", 700}, {"empty month falls back", 2, "", 700}, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { t.Parallel() got := CalculateFee(tc.count, tc.month) if got != tc.want { t.Errorf("CalculateFee(%d, %q) = %d, want %d", tc.count, tc.month, got, tc.want) } }) } }