You asked about basic testing of a used D90 but I have commented for DSLRs in general. Much but not all will apply to a D90 and most will be useful in most cases.
If you can devise a high reliability way of doing this you can make money from it. Alas, modern DSLR camera are complex electromechanical mechanisms which have many potential ways of going wrong. About the best you can manage is to establish a list of guidelines and "clues" to look for.
The following reads like a list of do this and this and this and ... BUT in reality you are unlikely to want to do all the following and the seller may not be completely happy given the time taken if you did everything I mention. However, this gives a reasonable idea of things which can be considered and of the sort of thing that you are looking for.
If a user has looked after the camera carefully it has an increased chance of lasting longer, but this is not a certain guideline. There are enough things that can go wrong that user care is not the sole factor.
User care will be somewhat evident by camera condition. Rubs and scratches and dirt and scuffed corners and connector working well and rubber seals fitting hom properly (and present) and ... . If the user has the original box and packing etc it's often (not always) an indication of a careful style. Is there a screen protector on the LCD. Are there neutral or polarising filters on any associated lenses. Is there a body cap if no lens fitted?
Take some photos and check quality. Best checked on a PC size screen. On camera LCDs can give a better or worse impression of quality than actual.
Is any warranty offered. This can indicate the confidennce that the seller has in the product.
The biggest single think that wears out with use regardless of user carefulness is the shutter mechanism. The rated shutter activations varies very widely with model. From as low as 50,000 to as much as 300,000. Some brands provide a means of establising the number of activations. Some don't. IO have never found a means of doing this with Minolta DSLRs and Sony also do not seem to do it, but this can be hidden very well from users. As with cares and distance travelled, be suspicious of claims of very low shutter activations. I do not know if any counters can be tampered with but it's certainly a possibility. A new shutter mechanism may cost much of the replacement cost of a secondhand camera. That said - I've had a number of DSLRs usefully exceed their claimed shutter count rating.
You would not expect noticeable dustiness in the shutter box.
Sensor dust is no great problem. It happens at variable rates to all DSLRs and cleaning is a standard procedure. If a camera being sold by a dealer has a dusty sensor you could ask for a free sensor clean as part of the sale, See my sensor dust test in a recent post.
Sensor damage is more important. This may occasionally happen due to physical damage - this is unlikely. More common are "hot pixels" which never change state or show a coloured dot. This can be checked by taking a photo on Manual with the lens cap on and looking at the should-be-totally-black image with magnification. Turn off long exposure noise reduction when doing this - as this is exactly the sort of thing it is designed to deal with. A few hot pixels or dead pixels are unlikely to bother you.
Note that hot-pixels may also occur in your LCD or EVF - be sure which you are seeing effects from.
Things that definitely wear out are buttons and control wheels. Give all buttons a good workout. Ensure that all control wheels do their job well. An annoying fault is encoder bounce or skip for whatever reason - when a control wheel is rolled smoothly in one direction the controlled function either changes unevenly or even jumps to and fro in its range. I've had both these happen and have seen it discussed elsewhere so it's a definite possibility.
If their are rubber seals on battery and memory card doors and cable and other entry points check to see that they fit well, are retained properly and are not torn or worn.
Connectors should plug in smoothly and not be intermittent in operation. eg plug in a USB cable and connect to a PC. Once recognised, wriggle the connector at entry point to camera. The PC will announce audibly if connection is broken even briefly. Consider trying a download. Check that the external flash connector works. Is there a protector on the hotshoe? - Did the camera come with one.
For cameras with external mechanical lens focusing drive, ensure that focusing is smooth and consistent. Try with more than one lens if in any doubt. Initiate AF (half pressure on shutter button or other). Point camera at something close and ensure it focuses then out to an object at infinity and focus again. repeat several times so that lens is driven across range. This tends to be more a lens test than a camera test.
Wriggle lens on mount when locked in position. Camera should not be aware that you are doing this and mocement should be utterly minimal. Ensure lens can mount and demount smoothly. Ensure that lens locking button works.
LCD screen at rear will ideally be scratch free, BUT even quite noticeable marking can have no great affect on viewability when lit. Ensure LCD brightness and quality is as expected. This varies immensely between brands and models.
Check eye piece / viewfinder / EVF is OK. This is much less liable to be damaged than is the LCD.
Has it got an articulating LCD. Ensure it moves as expected and that display does not flicker or go out with movement.
Some cameras report battery capacity. Note this if available.
You are not liable to easily spot much wrong mechanically. The ability to take photos rapidly and correctly is probably as good a mechanical behaviour indicator as any. Take a burst of rapid shots to ensure camera behaves well under multiple shots. Set to standard compression, JPG, max frame rate and take a burst of photos until the buffer fills.
There's more, but that's a start :-).