The absolute best test of the 4WD system is to get the front-end up on jack-stands, with the hubs UN-LOCKED, transfer-case in 2WD, both front wheels should rotate WITHOUT turning the axle-joints visible inside the knuckles.
Now grab the front drive-shaft; it should turn freely and rotate at least one of the axle-joints.
While under there, check the front drive-shaft U-joints and slip-yoke; while either is not a deal breaker, you can point out any problems to the seller and possibly get the price down.
Now, LOCK ONE hub; when you rotate that wheel, you should hear/feel the hub "click" into lock and the axle-joint on that side should also now turn with the rotations of the wheel; UNLOCK that hub and go to the other side, LOCK it and test as before.
Now, LOCK both hubs and turn the front drive-shaft; one or both wheels should turn with it; while turning the shaft, have someone hold the rotating wheel and the other should immediately start turning.
Now, shift into 4-HI and you should not be able to rotate the front shaft; do likewise in 4-LO.
Now, drive the truck into a place that it loses traction in 2WD, somewhere like a grassy hill-side, or maybe a shallow ditch; when it is definitely un-able to dig it's way out, then lock the hubs, shift into 4-LO, and it should walk out of there with ease; if so, the 4WD is probably okay.