Was my pregnancy test correct?

I had protected sex 20 days ago, ( 3 weeks tomorrow) my boyfriend wore a condom, but put it on backwards and didn’t think to get a new one. After that I had my withdrawl bleed from my BC, a week later. My pill had recently been giving me bad side effects ( after being on it 1.5 years) so I’m concerned it isn’t working. I took a pregnancy test this morning and it was negative. Can I trust that? Is my pill still protecting me? The only weird thing going on is these weird sharp pains in my boobs, but it’s on and off and mainly only in one. May just be from my pill. Help!!