0

This might have been asked several times but I couldn't find a clear and precise answer

What is the default visual studio unit test executor? I mean the one used when I trigger a unit-test run from the test explorer window

Also what is the Resharper one (from test triggered in the unit test sessions)?

lorenzo.urbini
  • 113
  • 1
  • 10

1 Answers1

1

Don't get confused betweeen a test runner and the framework that the tests are written in. Visual studio uses the built in test runner by default. By default this only understands tests written in MStest. Plugins are available that allow it to understand other test frameworks (NUnit, XUnit etc).

Resharper uses its own test runner to execute tests and this understands MSTest, NUnit by default (maybe others) by again plugins are avalilable to allow XUnit MSpec and others to be understood.

Sam Holder
  • 32,535
  • 13
  • 101
  • 181
  • well my question was more around vstest.exe or mstest.exe not mstest as the test framework... – lorenzo.urbini Nov 07 '14 at 15:31
  • I believe that in visual studio test window the default runner is vstest.executionengine.exe, but you could use procmon to verify that MSTest.exe is not invoked at all. – Sam Holder Nov 07 '14 at 15:33
  • thanks, do you know what Resharper uses instead... i know is possible to enable the legacy one from the options (which i guess is mstest.exe)? – lorenzo.urbini Nov 07 '14 at 15:37
  • 1
    I believe that Resharper uses their own test runner. It comes with several dlls like: JetBrains.ReSharper.UnitTestRunner.nUnit.dll JetBrains.ReSharper.UnitTestRunner.MSTest09.dll, JetBrains.ReSharper.UnitTestRunner.MSTest10.dll, JetBrains.ReSharper.UnitTestRunner.Javascript.dll, so no I don't think they use MSTest at all (old version sof Resharper had quite a few problems with MSTest tests, which wouldn't have been there if they just delegated to MSTest.exe – Sam Holder Nov 07 '14 at 15:44
  • i care when i want to automate the test runs from scripts and want to use exactly the same test runner i'm using in visual studio to have some consistency in test results, sometimes the behaviour between the 2 is different for example they use different test drop paths etc.. – lorenzo.urbini Nov 07 '14 at 15:48
  • Whilst that is a noble aim, its unlikely that you will be able to do that. Some runners may require VS to be available (like the vs default testing engine), others may not be invokable without other components available (Like the resharper one). We have had issues getting tests to run the same in all environments, but these have always been resolvable using the corect configuration and by not using some 'hack' or assumption made in one environment – Sam Holder Nov 07 '14 at 15:52
  • Some runners may require VS to be available.. is not this just the vstest,console.exe command? – lorenzo.urbini Nov 07 '14 at 15:58
  • I don't know, I think VS test window runs them with vstest.executionengine.exe and this may not run without vs being available. It might, but it might not. – Sam Holder Nov 07 '14 at 16:05