Pregnancy test

How early can I take a test and it be right?