Search code examples
c#visual-studiovisual-studio-extensionsvisual-studio-test-runner

Custom Test Adapter is not showing tests on Test Explorer


I am trying to implement a custom Test Adapter, all the files are bellow:

Using

vstest.console.exe /listdiscoverers /usevsixextensions:true

I confirmed that the extension is installed and it is listed on the test discoverers.

Running

vstest.console.exe file.ts

I confirmed that both TSTestDiscoverer and TSTestExecutor are working correctly.

Now I want to list the tests on Test Explorer, for that I guess I need ITestContainer and ITestContainerDiscoverer. I tried to implement both, but something is not working, the Test Explorer does not show any tests...

What did I do wrong? How can I find out what is not working?


Solution

  • I forgot to add an attribute on the class that implements ITestContainerDiscoverer.

    [Export(typeof(ITestContainerDiscoverer))]
    

    Now it is working.