Methods for measuring the capacitance of a capacitor