pregnancy test?

if i had unprotected sex on friday night and i’m supposed to receive my period next Wednesday, can i take a pregnancy test before then?