【问题标题】:In spec flow is scenario context Injection thread safe?在规范流程中场景上下文注入线程安全吗?
【发布时间】: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


【解决方案1】:

是的,我相信它是线程安全的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-30
    • 2018-12-08
    • 1970-01-01
    • 2010-10-16
    • 1970-01-01
    • 2023-03-15
    • 1970-01-01
    相关资源
    最近更新 更多