Tuesday, July 19, 2011

Parameterized unit tests with JUnit 4 (Locke's Socks)

Parameterized unit tests with JUnit 4 (Locke's Socks)
If you've ever found yourself writing a series of tests which differ only in their inputs and expected results, you've probably realized that the sensible thing to do would be to abstract your tests into a single test that can be run against a varying set of data. JUnit 4 allows you to do this with either theories or parameterized tests; here, I'll discuss the latter.

No comments:

Post a Comment