2 ms·
I usually start with an "it works" test that calls each method with expected inputs and asserts an expected result. The expected result most of the time is that
by vpeters25 12y ago
I usually start with an "it works" test that calls each method with expected inputs and asserts an expected result. The expected result most of the time is that it didn't throw an exception. I found that such tests usually cover most of each method and are pretty effective at detecting regressions.
When I'm fixing a bug, I first create a test that fails when reproducing the conditions that cause it, then I make necessary changes until that test passes.