Accidental shooting goes to court