Is there a way to get the name of the currently executing test from ie the Setup method of a test fixture?

有帮助吗?

解决方案

Have a look at the TestContext:

    [Test]
    public void Pass()
    {
        Console.WriteLine("Test name: {0}", TestContext.CurrentContext.Test.FullName);
    }
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top