Trying to have a baby

I have been trying to have a baby for about 5 years now. My doctor wants me to get tested for endometriosis but I think my issue is from being on birth control for 4 years because of my mom. Has anyone been through this should I get the surgery.