Going on the pill

Does going on the pill 100% prevent all pregnancies?? My boyfriend came inside me but I'm on the pill, should I be taking a pregnancy test or will it be okay?