Created
April 8, 2014 16:22
-
-
Save jstrassburg/10150992 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.whatever; | |
import org.junit.Assert; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.junit.runners.Parameterized; | |
@RunWith(value = Parameterized.class) | |
public class MyTest { | |
private String _myParameter; | |
public MyTest(String myParameter) { | |
this._myParameter = myParameter; | |
} | |
@Parameterized.Parameters | |
public static Collection<Object[]> data() { | |
Object[][] data = new Object[][] { | |
{ "value1" }, { "value2" } | |
}; | |
return Arrays.asList(data); | |
} | |
@Test | |
public void testSomething() throws Exception { | |
String expected = "a value"; | |
String actual = doSomething(_myParameter); | |
Assert.assertEquals(expected, actual); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment