Skip to main content

how to get the assembly contains the feature file

Answered

Comments

2 comments

  • Viktor Nemes

    You can inject the ITestRunnerManager to your code and get the assembly containing the feature files from the TestAssembly property:

    public sealed class Steps1
    {
    private readonly ITestRunnerManager _testRunnerManager;


    public Steps1(ITestRunnerManager testRunnerManager)
    {
    _testRunnerManager = testRunnerManager;
    }

    [Given("the first number is (.*)")]
    public void GivenTheFirstNumberIs(int number)
    {
    //access the TestAssembly
    var assembly = _testRunnerManager.TestAssembly;
    }
    }
    1
  • 陈 俊杰

    Thank you Viktor.

    0

Please sign in to leave a comment.

Powered by Zendesk