crank sensor

how much was the crank sensor and where is it located to change it.
Also, is there a way to test it?
thank you!