title: Azure Devops Visual Studio Tests task cannot discover Nunit tests with the TestCaseSource attribute
body: <p>I am trying to use the [TestCaseSource] attribute from Nunit with my automated tests run from Azure DevOps. </p>
  
  <p>Example: <em>this test is not discovered</em></p>
  
  <pre><code>public static object[] TestSource = new[]
  {
      new[] { new MyType() },
      new[] { new MyType() },
      new[] { new MyType() }
  };
  [Test, TestCaseSource("TestSource")]
  public void MyTestMethod(MyType value)
  {
      ...
  }
  </code></pre>
  
  <p>Unfortunately my test methods cannot be executed because of the "<em>No test assemblies found on the test machine matching the source filter criteria or no tests discovered matching test filter criteria. Verify that test assemblies are present on the machine and test filter criteria is correct.</em>" error.</p>
  
  <p>However when I remove the TestCaseSource attribute from the test methods the tests <strong>are</strong> able to be executed, meaning they can be found normally, which leads me to the problem that the TestCaseSource attribute is making my tests undiscoverable.</p>
  
  <p>Example: <em>this test is discovered</em></p>
  
  <pre><code>[Test]
  public void MyTestMethod()
  {
      ...
  }
  </code></pre>
  
  <p>I believe I've setup something wrong in the release and that this should work since the [TestCaseSource] test methods <strong>do work</strong> fine when I run the tests from Visual Studios Test Explorer.</p>
  
  <p>My DevOps release pipeline is pretty simple, I use an extract files task with an Archive file patterns like "<em>$(System.DefaultWorkingDirectory)/SolutionName/drop/SolutionName.Tests.zip</em>" and a destination folder of "<em>$(System.DefaultWorkingDirectory)/tests</em>"</p>
  
  <p>then I have a Visual Studio Test task (2.) that selects test by Test run and search folder of "<em>$(System.DefaultWorkingDirectory)/tests</em>"</p>
  
  <p>My best guess is that maybe I need to set the "<em>Path to custom test adapters</em>" field of the Visual Studio Test task to the NUnit3Adapter Nuget package in my tests project but I am unsure of where/how to get the path to it.</p>
  
  <p>Do I need to change my pipeline to include the NUnit3Adapter, or is there another reason why my tests are undiscoverable? 
  I have searched extensively for a reason and as far as I can find no one else is having this issue with [TestCaseSource] leading me to believe I have done something wrong.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>After more searching and investigation I think I've found the root of the issue, but I don't know how to fix it. </p>
  
  <p>When I associate my test methods through visual studio Test Explorer to the Azure DevOps Test cases for associated automation, The name of the test method is not set correctly. </p>
  
  <p>Example: <em>given this test method from before</em></p>
  
  <pre><code>public static object[] TestSource = new[]
  {
      new[] { new MyType() },
      new[] { new MyType() },
      new[] { new MyType() }
  };
  [Test, TestCaseSource("TestSource")]
  public void MyTestMethod(MyType value)
  {
      ...
  }
  </code></pre>
  
  <p>If I associate the <em>MyTestMethod</em> to a work item, the "Automated test name" field in DevOps will show "SolutionName.Tests.MyTestMethod" as the value.</p>
  
  <p><a href="https://i.stack.imgur.com/hdaEo.png" rel="nofollow noreferrer"><em>you can see here</em></a></p>
  
  <p>However I believe this is wrong and instead the name needs to be "<strong>SolutionName.Tests.MyTestMethod(MyType)</strong>"</p>
  
  <p>I think this because at one point somehow I did get one of my tests associated like "SolutionName.Tests.MyTestMethod(MyType)" and it worked fine.</p>
  
  <p>My question now is how do I get the "associate test case" function to include the <strong>(MyType)</strong> at the end of the test method name?</p>