Pregnancy test

How many days after unprotected sex should I take a test? My period is due in 6 days. Should I wait to see if it comes? I had the unprotected sex yesterday