'Is there a way to associate Automated tests to Test Cases in Azure DevOps using VS Code?

I've been looking for an extension for VS Code that will allow the "Associate Test Case" functionality provided with Visual Studio IDE and I have had no luck. Is there an extension that provides this functionality?

Visual Studio steps:

  1. Open Test Explorer
  2. Right click on a Test Case
  3. Click on Associate To Test Case

Screenshot:

VS Associate To Test Case



Solution 1:[1]

Check this extension that I have created https://github.com/JanuszNowak/janono.ado.testcase.associate.cli it allows associating in automatic manner. For now this is CLI, that you can run as vs-code task. Later I will create also dedicated Azure DevOps task. Visual Studio is not needed to run automatic association. Code sample:

namespace ExampleTestProject
{
    [TestClass]
    [janono.ado.testcase.associate.Organization("janono-pub")]
    public class UnitTest1
    {
        [TestMethod]
        [janono.ado.testcase.associate.TestCase(5)] //<---
        public void TestMethod1()
        {
            //yours test method content
            //...
            //
        }
    }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Janusz Nowak