An alleged killer stabbed a man at least 10 times in the garden of a York house and injured a second man, a jury has heard.