Pregnancy

I just had sex and its with somebody I don't know and he ejeculated in me and I'm scared that I might get pregnant.When should I take the pregnancy test?