title: How to get current TestContext in TeamCity NUnit runner
body: <p>In NUnit, it is possible to get the current test with <code>NUnit.Framework.TestContext.CurrentContext</code>. When I run tests on my local machine, this is correctly populated during testing. However, when pushed to a dev server running TeamCity, this data structure has some problem causing errors. These errors occur when accessing <code>context.Test.FullName</code>, <code>context.Test.Name</code>, and <code>context.Result</code>. For example, with the following code:</p>
  
  <pre><code>var name = NUnit.Framework.TestContext.CurrentContext.Test.Name;
  </code></pre>
  
  <p>this exception occurs, but only when TeamCity is running the tests:</p>
  
  <pre><code>TearDown method failed. TearDown : System.NullReferenceException : Object reference not set to an instance of an object.
  --TearDown
     at NUnit.Framework.TestContext.TestAdapter.get_Name()
  </code></pre>
  
  <p>Is TeamCity not populating the <code>TestContext</code> or is there a correct way to get this data?</p>