1

I'm a bit stuck with the problem of creating a custom adapter for the Visual Studio test explorer. (Btw I'm using VS 2019). I need to create my own test framework, for sure, with my own test attributes, that the Test Explorer can detect. Just a little bit of information I could find while researching and I tried the suggested solutions but it didn't work for me:

  1. Create a project and implement ITestRunner and ITestDiscoverer. Copy the output .dll to "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions". Of course, it created a test adapter for test running and executed my tests well, but not discovered any one using Visual Studio.
  2. Create a nuget package from this project and add it to a target project.
  3. Download source code of NUnit and tried to analyze but, actually, I didn't find any point that describes a test discovering for the Test Explorer of VS. But if I try to create a nuget package locally from this source project of NUnit, it works. All test can be found by test explorer using NUnit test attribute.

Can anyone help me, what is a right way to do the integration with the Visual Studio Test Explorer?

Jack J Jun
  • 5,633
  • 1
  • 9
  • 27
YVEF
  • 139
  • 1
  • 9
  • 1
    I think you should create the [build-in vsix project](https://learn.microsoft.com/en-us/visualstudio/extensibility/starting-to-develop-visual-studio-extensions?view=vs-2019) and then implements such interface in it. The vsix project works for vs-sdk. You can use that project template to extend the feature of VS IDE. –  Oct 29 '20 at 09:57

1 Answers1

0

Late to the party, but for anyone coming afterwards:
you might want to look at this previous SO question and e.g. this answer of mine.

superjos
  • 12,189
  • 6
  • 89
  • 134