package fees import "testing" func TestCalculateJuniorFee(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_junior_fee; print([calculate_junior_fee(c,m) for c,m in [(0,"2026-05"),(0,""),(1,"2026-05"),(1,"unknown"),(2,"2026-05"),(2,"2025-09"),(2,"2026-03"),(5,"2025-09"),(2,"2027-01"),(2,"")]])' tests := []struct { name string count int month string want Expected }{ {"zero short-circuits", 0, "2026-05", Expected{Value: 0}}, {"zero empty month", 0, "", Expected{Value: 0}}, {"single practice sentinel", 1, "2026-05", Expected{Unknown: true}}, {"single ignores monthKey", 1, "unknown", Expected{Unknown: true}}, {"two practices default month", 2, "2026-05", Expected{Value: 500}}, {"two practices reduced sept", 2, "2025-09", Expected{Value: 250}}, {"two practices reduced march", 2, "2026-03", Expected{Value: 250}}, {"high count same as two", 5, "2025-09", Expected{Value: 250}}, {"unknown future month falls back", 2, "2027-01", Expected{Value: 500}}, {"empty month falls back", 2, "", Expected{Value: 500}}, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { t.Parallel() got := CalculateJuniorFee(tc.count, tc.month) if got != tc.want { t.Errorf("CalculateJuniorFee(%d, %q) = %+v, want %+v", tc.count, tc.month, got, tc.want) } }) } }