I am new to testing. I would like to know:

 - What is component testing? 
 - How do I write component test cases?

Please explain with examples if possible to make it more helpful for me to understand.