How I can unit-test APIs? How I can unit-test APIs? Is there any method for asserting API response in drupal 7?
You can find an example in the Examples for Developers module. Here are two excellent guides:


Simpletest Testing tutorial
Unit Testing with SimpleTest