You can test a dehumidifier’s humidistat fairly easily using a volt-ohm meter. Just set the meter to the RX1 scale and attach its leads to the humidistat’s terminals. Rotate the humidistat’s knob as far as it will turn in both directions. If the volt-ohm meter registers zero ohms through only part of the humidistat dial’s range, the humidistat is working. If it registers zero through the entire range, it’s broken and must be replaced.
Also using a volt-ohm meter, you can tell if the overflow switch works or not. Clip the leads to the terminals on the switch. Depress the bar or trip lever on the switch. If the meter’s needle does not show continuity and also no continuity as the switch is clicked back and forth, the switch is probably faulty and will need to be replaced.