using TechTalk.SpecFlow.Assist
1. CreateInstance<T>| LanguageName | LanguageLevel|
| Indian | Basic |
var lan = table.CreateInstance<Languages>();
2. CreateSet<T> - horizontal data
| LanguageName | LanguageLevel|
| Indian | Basic |
| French | Conversational |
| Spanish | Fluent |
| Mandarin | Native/Bilingual |
Create a class, table header must match with the members
public class Languages
{
public string LanguageName{get;set;}
public string LanguageLevel{get;set}
}
In Step Definition
var languages = table.CreateSet<Languages>();
foreach(var lan in languages)
{
lan.LanguageName
lan.LanguageLevel
}
3.Dynamic
using Specflow.Assist.Dynamic, Install nuget package first
dynamic credentials = table.CreateDynamicInstance();
IEnumerable <dynamic> credentials = table.CreateDynamicSet();
No comments:
Post a Comment