Using CompareToSet with a simple list of strings
I must be overthinking this or something, because this is ridiculously simple, but I can't get it to work.
I'm writing a regression test to verify that a drop down list contains the correct set of choices. I have a feature file with a simple 1 column table containing the list:
Then the dropdown list is populated with the following choices:
| DropDownChoice |
| Choice 1 |
| Choice 2|
| etc |
In my step definition, I'm retrieving the choices for the drop down list from the page object as List<string>,
and then I want to to use table.CompareToSet(list)
public void ThenTheDropdownListIsPopulatedWithTheFollowingChoices(Table table)
{
List<string> choiceList = _pageObject.getDropDownChoices;
table.CompareToSet(choiceList);
}
I mean, for what I want to do, it should be just that simple. But no matter what I do, I keep getting "Field not found: DropDownChoice"
I even tried creating a DropDownRecord type with a single string field named DropDownChoice, and using a Linq statement to create a list of that record type from the list of strings, but I still get the same error.
Can somebody give me some tips as to what I'm doing wrong?
Thanks in advance.
Dave Hanna
Please sign in to leave a comment.
Comments
0 comments