Pregnancy test

Can i take a pregnancy test if it has been 12 days since i have had sex... And will the test be right?