How quickly

How quickly can pregnancy be detected on a pregnancy test?? If I had unprotected sex a week ago and my period is two days away would it come up on a test? Or is it to early??