Unprotected sex

My period is 8 days late I had unprotected sex a week before my period and I still haven’t taken a test because I also recently have had unprotected sex......will that change the results of the test?....can I take a test or should I wait?