• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package junitparams;
2 
3 import static org.assertj.core.api.Assertions.*;
4 
5 import java.util.ArrayList;
6 import java.util.Arrays;
7 import java.util.List;
8 
9 import org.junit.Test;
10 import org.junit.runner.RunWith;
11 
12 @RunWith(JUnitParamsRunner.class)
13 public class IterableMethodTest {
14 
15     @Test
16     @Parameters
shouldHandleIterables(String a)17     public void shouldHandleIterables(String a) {
18         assertThat(a).isEqualTo("a");
19     }
20 
parametersForShouldHandleIterables()21     public List<Object[]> parametersForShouldHandleIterables() {
22         ArrayList<Object[]> params = new ArrayList<Object[]>();
23         params.add(new Object[]{"a"});
24         return params;
25     }
26 
27     @Test
28     @Parameters
shouldHandleSimplifiedIterables(String a)29     public void shouldHandleSimplifiedIterables(String a) {
30         assertThat(a).isEqualTo("a");
31     }
32 
parametersForShouldHandleSimplifiedIterables()33     public List<String> parametersForShouldHandleSimplifiedIterables() {
34         return Arrays.asList("a");
35     }
36 }