Skip to content

Instantly share code, notes, and snippets.

@horte
Created July 24, 2013 13:40
Show Gist options
  • Save horte/6070672 to your computer and use it in GitHub Desktop.
Save horte/6070672 to your computer and use it in GitHub Desktop.
Example of Parameterized test.
@Parameterized.Parameters
public static Collection<Object[]> generateData()
{
List<Object[]> data = new LinkedList<>();
//check limit and offset
data.add(new Object[]{generateParameters("league=55581"), generateExpectedValues("positionStatuses=true;labels.type=group;stats.name=gp,w,d,l,ga,gf,gd,pts")});
data.add(new Object[]{generateParameters("league=55581;size=small"), generateExpectedValues("positionStatuses=true;labels.type=group;stats.name=gp,pts")});
data.add(new Object[]{generateParameters("league=54275;size=medium"), generateExpectedValues("positionStatuses=true;labels.type=group;stats.name=gp,w,d,l,gd,pts")});
data.add(new Object[]{generateParameters("league=57973;size=large;round=3"), generateExpectedValues("positionStatuses=true;labels.type=group;stats.name=gp,w,d,l,gf,ga,gd,pts;stats.name.gp=3")});
data.add(new Object[]{generateParameters("league=55581;sort=team.name"), generateExpectedValues("positionStatuses=true;labels.type=group;stats.name=gp,w,d,l,ga,gf,gd,pts")});
data.add(new Object[]{generateParameters("league=55581;sort=stats.d,stats.pts,team.name"), generateExpectedValues("positionStatuses=true;labels.type=group;stats.name=gp,w,d,l,ga,gf,gd,pts")});
data.add(new Object[]{generateParameters("league=55581;group=B"), generateExpectedValues("labels.type=group;labels.name=B")});
return data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment