Home | History | Annotate | Download | only in junitparams
      1 package junitparams;
      2 
      3 import static org.assertj.core.api.Assertions.assertThat;
      4 
      5 import org.junit.*;
      6 import org.junit.runner.*;
      7 
      8 import junitparams.usage.person_example.*;
      9 
     10 @RunWith(JUnitParamsRunner.class)
     11 public class EnumsAsParamsTest {
     12 
     13     @Test
     14     @Parameters({"SOME_VALUE", "OTHER_VALUE"})
     15     public void passEnumAsString(PersonType person) {
     16         assertThat(person).isIn(PersonType.SOME_VALUE, PersonType.OTHER_VALUE);
     17     }
     18 
     19     @Test
     20     @Parameters
     21     public void passEnumFromMethod(PersonType person) {
     22         assertThat(person).isIn(parametersForPassEnumFromMethod());
     23     }
     24 
     25     private PersonType[] parametersForPassEnumFromMethod() {
     26         return new PersonType[] {PersonType.SOME_VALUE, PersonType.OTHER_VALUE};
     27     }
     28 }
     29