How to avoid getting swindled when buying used cranks? I'm looking for a cheap, used set of cranks for a bike that was fished out of the garbage :)

Because the cranks won't be on a bicycle when I go buy them, how can I tell if they're bent or not?

I'm thinking of taking a BB spindle and pedals along, putting the cranks on and trying to rotate them somehow...

Any ideas?
I've actually never seen bent cranks, so that's probably the least of your worries. And if they are bent, then I don't think you'd be able to tell until they're mounted on the bike.

Bringing pedals is a good idea - not to check for straightness, but to check if the pedal threads are damaged. If they're square-taper cranks, you should also check the dust cap threads - if they're messed up, you may not be able to take the cranks off again.