Skip to content

Instantly share code, notes, and snippets.

@thiagomarinho
Created July 9, 2014 16:58
Show Gist options
  • Save thiagomarinho/e03b52897abab3521b62 to your computer and use it in GitHub Desktop.
Save thiagomarinho/e03b52897abab3521b62 to your computer and use it in GitHub Desktop.
Exemplo de teste usando parâmetros
package net.thiagomarinho.testes;
@RunWith(Parameterized.class)
public class TesteParameterized {
private int id;
// O exemplo desse método tá bem pobre. Acho que posso melhorá-lo depois.
@Parameters(name = "registro #{0}")
public static List<Integer[]> data() throws Exception {
Integer[][] ids = new Integer[10][];
for (int x = 0; x < linhas.length; x++) {
Integer[] parametros = { linhas[x] };
ids[x] = parametros;
}
return Arrays.asList(ids);
}
public TesteParameterized(int id) {
this.id = id;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment