You can pass a comma separated string and then transform it into a list:
When i login to a site
then 'Joe,Bloggs,Peter,Mr,Some street,15' are valid
[Then("'(.*)' are valid")]
public void ValuesAreValid(List<String> values)
{
}
[StepArgumentTransformation]
public List<String> TransformToListOfString(string commaSeparatedList)
{
return commaSeparatedList.Split(",").ToList();
}
if you want the values to come from examples then you could do this instead:
When I login to a site
then '<values>' are valid
Examples
| values |
| Joe,Bloggs,Peter,Mr,Some street,15|
| Joe,Bloggs,Peter,Mr,Some street,16,SomethingElse,Blah|
If you want to use a table then you could do this instead:
When I login to a site
then the following values are valid
| FirstName | LastName | MiddleName | Greeting| Etc | Etc |
| Joe | Bloggs | Peter | Mr | you get| The Idea|
(you could omit the headers if you want and just use the row values I think)
you can also use examples with this:
When I login to a site
then the following values are valid
| FirstName | LastName | MiddleName | Greeting | Etc | Etc |
| <name> | <lastName>| <middleName>| <greeting>| <etc> | <etc> |