Yes, there is a test that you can take. It is called a sono-hystogram. I was supposed to have one before I got pg again due to a thin lower uterus caused by 2 c/s. I just found out I am pg again, it is a huge surprise and I never got around to having the test.
Your uterus lining is the one that hold and nuture you baby. If your uterus lining so thin, the eggs can't implant. I think there are medicine (either pills or shot) that will keep the baby if you are pregnant. Ask you dr about this too.