I\'m planning on writing unit tests for a REST-ful API and I\'m wondering about the approach I should take.
The aspect that concerns me the most is related to the datab
Usually, in unit tests, you try to remove all dependencies beyond the unit (usually a function/class/object) that you are testing. The classic way to accomplish this in your case (for databases) is through the use of mocks. http://en.wikipedia.org/wiki/Mock_object
Basically, you implement a "FakeDatabase" that shares the API of the actual database that returns known values.