It is VERY unlikely that you would get pregnant having sex up to about 10 days before your period. It's past ovulation and the closer you get to your period due date, the less fertile you are.
If you had a "normal" period you were NOT pregnant beforehand either.
You had sex on day 5 of your cycle. Sperm can survive up to about 5 days. If you ovulate early your boyfriend is the likely father.
Your doctor is correct. Dates are based on your LMP. You are 4 weeks along even though conception occurred about two weeks later.
It takes about two weeks for the tests to become accurate but sometimes it can take longer. Dont' worry about when you had the positive test.
Assuming you had a normal period on April 27, your boyfriend is, with almost 100% certainty, the father.