OpenUser
OpenUser

Reputation: 158

How to create an adapter for the Visual Studio Test Explorer?

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?

Upvotes: 2

Views: 1064

Answers (1)

superjos
superjos

Reputation: 12725

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.

Upvotes: 0

Related Questions