【发布时间】:2016-03-02 10:29:58
【问题描述】:
http://www.specflow.org/documentation/Context-Injection/
[Binding]
public class MyStepDefs
{
private readonly PersonData personData;
public MyStepDefs(PersonData personData) // use it as ctor parameter
{
this.personData = personData;
}
[Given]
public void The_person_FIRSTNAME_LASTNAME(string firstName, string lastName)
{
}
}
PersonData 线程安全吗?
【问题讨论】:
-
为每个场景或每个功能创建绑定类(上面的 MyStepDefs)......如果它是每个功能,那么如果我们并行执行测试并且采用两个不同的场景输出行不同的线程?
标签: c# specflow context-injection