I know that iPhone has some internal sensors that can be used to test if the device was got ever wet.
Apple uses them in order to deny your warranty.
The question is how to find out this before sending your device to service?
Those sensors are no electrical sensors, but pieces of paper that change from white to red when they get wet. There are up to two spots you can look at without opening the device. Have a look inside your headphone jacket and your dock connector. (use a torch/flashlight as lint or dim light can make these orangish-pink indicators hard to discern!)
Have a look at this page.
Here's the diagram for an iPhone 4/4S:
The page daviesgeek linked to shows the 2 external indicators. There are also two internal indicators.
I used to work at the Genius Bar. On any phone, we were required to check the two external liquid indicators before working on it. If one of them was red, we had to open the phone and look at the internal ones. If you had one red one external indicator and the internal ones were white, you were cool. If the internal ones were red, SOL- it was considered liquid damage and not covered.
I've seen phones where the external ones were both white but the internal ones were red too. That would not be covered by warranty either. So if your phone is going to be opened, they'll know anyway.
Opening an iPhone is super easy. There are two screws on the bottom that you have to remove. If you have a 3G or 3Gs, you can use a suction cup to pop the screen up. If you have a 4 or a 4S, you'll probably need one of those special security screwdrivers, but after taking the bottom screws out you just slide the backplate upward and off.
The liquid indicators are on the back side of the phone on the 4 and 4S and underneath the display on the logic board on the 3G and 3GS. You don't have to break the phone down that far to look at them.
If it's liquid damaged and you have an Apple store near you, it's probably better to take it there in person because if you're nice they might make an exception for you. Especially if you have AppleCare on your phone.
If it's liquid damaged and you can't get an exception, there's a replacement fee of $199 (this cost is in US dollars- just saw the poster's location). They will just replace your phone outright, so back it up.
The location of internal sensors varies widely by model, but the iFixit guides do a nice job of calling out some of the indicators that show a soaking amount of water has come into contact with the electronics of the device.
In practice, just take a lighted magnifying glass to the headphone jack and the 30 pin connector and don't bother taking your phone apart unless you're sure you've got the tools and a static safe environment to avoid damaging the internals.