title: Access NUnit Test Name within TestCaseSource
body: <p>I have a series of tests where I want to use the same testcase data for a bunch of different tests. </p>
  
  <p>eg: </p>
  
  <pre><code>[Test, TestCaseSource("TestData")] 
  public void Test1(Foo foo)
  {
      // test 1
  }
  
  [Test, TestCaseSource("TestData")] 
  public void Test2(Foo foo)
  {
      // test 2
  }
  
  private static IEnumerable TestData() 
  {
     TestCaseData data; 
  
     data = new TestCaseData(new Foo("aaa"));
     yield return data; 
  
     data = new TestCaseData(new Foo("bbb"));
     yield return data; 
  }
  </code></pre>
  
  <p>This leads to a series of tests that report like so: </p>
  
  <pre><code>Namespace.That.Is.Very.Long.TestClass.Test1(Namespace.That.Is.Very.Long.Foo)  
  Namespace.That.Is.Very.Long.TestClass.Test1(Namespace.That.Is.Very.Long.Foo)  
  Namespace.That.Is.Very.Long.TestClass.Test2(Namespace.That.Is.Very.Long.Foo)  
  Namespace.That.Is.Very.Long.TestClass.Test2(Namespace.That.Is.Very.Long.Foo)  
  </code></pre>
  
  <p>...which isn't hugely meaningful when you don't know what 'foo' failed.. </p>
  
  <p>If <a href="https://stackoverflow.com/questions/23332726/nunit-set-test-name-programmatically">as suggested in this SO question</a> I set the name like this: </p>
  
  <pre><code>   data = new TestCaseData(new Foo("aaa"));
     data.SetName("foo=aaa");
     yield return data; 
  </code></pre>
  
  <p>...then all my tests come out looking like this: </p>
  
  <pre><code>foo=aaa   
  foo=bbb  
  foo=aaa  
  foo=bbb 
  </code></pre>
  
  <p>So I'm trying to figure out how to get the current test method name. That would appear, <a href="https://stackoverflow.com/questions/3588486/how-to-access-the-nunit-test-name-programmatically">as described in this other SO question</a> be done via TestContext. </p>
  
  <p>However, while TestContext.Current.Test exists, all the properties (like Name) throw a NullReferenceException when trying to access them. </p>
  
  <p>Is there some other way to achieve this goal of providing more useful information in the test name?</p>