Cancer cannot be diagnosed from an x-ray. X-rays show densities. There is no approved urine test to diagnose cancer.
I don't think they can say 100% that someone has lung cancer, however they can see a spot on a X-ray that looks like cancer and add experience to that , and they can be 98% sure if a person has cancer. Urine tells a lot. If there are certain factors in your urine that are reminiscent of cancer, they again with experience can say it looks like cancer is a big possibility. And then require further testing.