I am writing an addin - a new command to the Test Explorer context menu. I have the addin ready with a new command that appears on the right click context menu for test explorer, now I need to know which test is selected from the test explorer window. How do I do that?
I have tried using below but it gives me the documentwindow currently selected not the object (test) from the test explorer. Any help is very much appreciated.
The value of y is shown as xxx.cs the file that's currently open :(ServiceProvider sp = newServiceProvider(_applicationObject as Microsoft.VisualStudio.OLE.Interop.IServiceProvider); IVsMonitorSelection mSelection = (IVsMonitorSelection) sp.GetService(typeof(SVsShellMonitorSelection)); var cSelection = VSMonitorSelectionExtensions.GetCurrentSelection(mSelection);
object y; var z = cSelection.Item1.GetProperty(cSelection.Item2, (int)__VSHPROPID.VSHPROPID_Caption, out y);