How I can create custom test case in VSIX extension for Visual Studio 2015?
In older version of Visual Studio I was using namespaces
but these namespaces are in VS2015 (Community) unavailable. Is there any alternatives to create custom test cases parsed from my specific format in VSIX extension?
In recent versions of Visual Studio (2012 and later), they added native support for custom test engines. To write one you would use the following interfaces (which have no documentation to speak of) in the Microsoft.VisualStudio.TestPlatform.ObjectModel
namespace:
ITestContainer
– Represents a file that contains testsITestContainerDiscoverer
– Finds all files that contain testsITestDiscoverer
– Finds all tests within a test containerITestExecutor
– Runs the tests found inside the test containerMore Information:
There are some tutorials(1)(2) that give step-by-step instructions and example code that use the APIs mentioned above. Due to the involved nature, I'm not going to repost the entire tutorials here. Note, while the posts were originally written against 2012RC, they are still valid for 2012 RTM, 2013, and 2015.