In Python, I often have tests which look something like this:
tests = [
(2, 4),
(3, 9),
(10, 100),
]
for (input, expected_output) in tests:
assert f(input) == expected_output
What is the "right" way to write tests like this (where a set of test cases is specified, then a loop runs each of them) in Java with JUnit?
Thanks!
Preemptive response: I realize I could do something like:
assertEquals(4, f(2))
assertEquals(9, f(3))
....
But... I'm hoping there is a better way.