I am new in testing. I want to know:

 - What is component testing? 
 - How to write component test cases?

Please explain with example if possible as that will be more helpful for me.