How do apple repairers find out what's wrong with iphones?

My iphone 3 only charges when powered off and plugged into my computer.computer and itunes dint recognise device.
Shopping centre has an iphone/ipod repair stall. He said its either the battery or something to do with hardware.
So i want to know how do they find out? Do they plug sonething in and run a check. I just don't want to get hit with a double charge like if he "thinks" its the battery so he replaces it but its not the priblem.

As per my experience, you no need to worry too much. Apple has pretty good after-sales service, I don't think they would charge you without a reason or just based on "thinks". They should do some tests at their background platform for your device and confirm the problem to you. You also can ask what you want to know and they should be patience to explain to you.

They're trained to do it so they know what the actual problem with the handset is. But I don't think its the hardware or the battery because if iTunes isn't recognizing the problem, then its something else. If you live in the US, go to the Apple Genius Bar. If not, go to an Apple retail store. They'll fix it.