How Do I Know If My Shift Interlock Solenoid Is Bad?

How do you test a shift interlock solenoid?

.

How do you know if your shift solenoid is bad?

How much does it cost to replace a shift interlock solenoid?

Will a bad shift solenoid throw a code?