I do test the camera as well as the lens when I buy one, brand new or used. Fortunately, I haven't experienced with the initial issues of the bodies, but a friend of mine who is professional photographer told me that there have been brand new cameras whose sensors are mis-aligned.
I experienced defect samples of the lenses of most of the makes I used: Nikon, Canon, Olympus and Fuji. In some cases, the manufacturers insisted that they were within their tolerances.