Java unit testing with parameter

Viewed 6179

In C#, it is possible to specify parameters for the same unit test method. Example:

[DataTestMethod]
[DataRow(12,3,4)]
[DataRow(12,2,6)]
public void DivideTest(int n, int d, int q)
{
   Assert.AreEqual( q, n / d );
}

Is it possible to do the same in Java? I have read Parametrized runner but this solution is not as easy to use.

4 Answers
Related