TestContext | NUnit Docs
docs.nunit.org › writing-tests › TestContextThe TestContext class allows tests to access certain information about the execution context. Note It's important to remember that "test" in NUnit may refer to an individual test cases or a suite such as a TestFixture. Within a test method, SetUp method or TearDown method, the context is that of the individual test case.
How to Initialize TestContext?
social.msdn.microsoft.com › Forums › en-USNov 28, 2011 · Regarding TestContext==null, make sure that your TestContext is a public property i.e.: privateTestContext testContextInstance; ///<summary>///Gets or sets the test context which provides///information about and functionality for the current test run.///</summary>publicTestContext TestContext { get{ returntestContextInstance; } set{ testContextInstance = value; } }
c# - Understanding the MSTest TestContext - Stack Overflow
stackoverflow.com › questions › 24249133Jun 17, 2014 · You can get this from the TestContext.TestName property. I found an unexpected difference in behaviour between a static TestContext that is passed in to the [ClassInitialize] method and one that is declared as a public property (and gets set by the test runner). Consider the following code: using System; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace TestContext.Tests { [TestClass] public class UnitTest1 { public TestContext TestContext { get; set; } private static ...