Visual Studio 2012 + NUnit => reports? - unit-testing

Starting in VS 2012, the test adapter support has been extended to allow UTs other than MSTest to run inside the IDE. Which is awesome.
My question is: using the NUnit test adapter to run my suite of NUnit UTs, how can I get a report of the results in a computer-readable format (i.e. xml)?
FWIW I run VS 2012 Professional.
I'd hate to have to fire the NUnit test runner GUI every time I need a report file.
Side question: did anybody running Resharper (7) successfully export the results of a sizable UT suite?
I have ~2500 UTs and the report (be it text or HTML) generated by Resharper stops abruptly at some point in the file.

My question is: using the NUnit test adapter to run my suite of NUnit
UTs, how can I get a report of the results in a computer-readable
format (i.e. xml)?*
Yes, there is a feature called "PlayList"
Select all your tests, and right click - select Add to play List -> New Playlist. Save the file as .playlist file. Now you can Save As an xml file.

Related

Troubles with executions of automation tests with Test Explorer in Visual Studio and MSTest

I use in my project SpecFlow to provide automation testing of web-site(with Selenium). I want create end-to-end test suite for provide full checking of project according to BDD. When I create tests playlist in test explorer in Visual Studio and start all tests in playlist all my tests launch according to their alphabetic name. But when I restart project and start this playlist newly all my tests launch in the wrong order. I think, that this problem may be because of rebuild playlist file, but I'm not sure. Could You help me, please?
TestRunner - MSTest

visual studio code unit test discovery frequency setting

When I'm updating my existing unit tests, Visual Studio code drops a status bar from the top letting me know that it could not correctly discover unit tests every time I save the file. This is expected since I'm actively typing so everything is not working python.
Have I configured something incorrectly? Is there some way to tell visual studio to chill out on the unit test discovery?
Of course, I can simply hit the "close" button, but this is extremely distracting.
Disable Live Unit Test running on the background.
Under Test->Test Settings-> uncheck 'Keep Test Execution Engine Running'. I am using VS 2017 & VS 2015.

ReSharper run all tests instead of a single one that is selected

I use ReSharper 10 and NUnit 3.
When I run my tests in Visual Studio all is good. But when I select a single test in ReSharper and run it or debug it then not the selected test is run but all the tests.
The same happens if I select a test in Resharper - Unit Tests - Unit Tests window or if I select it in the code (click on the icon at the left side of the test: http://prntscr.com/a1clt1
All my methods marked with [Test] attribute or [TestCase()] attribute
Is it a bug of ReSharper, of NUnit or maybe it can be set in settings?
Thanks for any help.
Install R# 10.0.2 build (the latest available here), it is fixed there https://youtrack.jetbrains.com/issue/RSRP-450313.

How can I disable code coverage / assembly instrumentation in Visual Studio 2012?

I have a project upgraded from Visual Studio 2010 to 2012 and the .testrunconfig file was included in the upgrade process.
I noticed that it was possible to click "Analyze code coverage" on any of the unit tests that I had run and it would correctly display the result. However, my test run configuration (originally from VS 2010) had code coverage disabled.
After doing a bit of research I learned that the VS 2010 configuration files have been deprecated and replaced by .runsettings files. It would appear that VS 2012 enforces assembly instrumentation by default which has a massive overhead associated with it.
Therefore, I would like to know how I can disable code coverage in VS 2012. Based upon my current findings it does not seem to be a trival task. One recent article I read had me creating an XML file manually and naming it "MYCONFIGURATION.runsettings" and manually manipulating XML attribute values.
Does anyone know how this should be done?
This is what I understand from your post:
You have a Test project with .testsettings file. You have not enabled code coverage in the test settings.
Code coverage instrumentation is not enabled by default in your scenario. Binaries will be instrumented if you do 'analyze code coverage' from VS.
Additional Info:
You can confirm that .coverage file is not generated by running the following command from visual studio developer command prompt:
vstest.console.exe /Settings:<your test settings file> test.dll
A coverage file will only get generated if you have enabled coverage in test settings.
Code coverage is only enabled through the Test Explorer using data driven adapters. The metadata for tests ran through the test explorer is almost completely different than that of tests ran straight from the unit test session window. Have you tried simply running it straight from the code (the MSTest gui bubbles) or from the unit test session window?

Integrate Silverlight Unit Testing with Visual Studio 2008 Test Results Panel?

I would like to run my Silverlight Unit Tests from Visual Studio instead of opening a new instance of my Silverlight Test App in the browser.
Apparently it is possible (http://www.jeff.wilcox.name/2008/09/rc0-new-test-features/ - search for "Visual Studio Team Test log provider output")....but I don't understand how you enable this, does anyone know how?
Would be great if these tests would run from the "Run All Tests in Solution" button (Ctrl+R, A).
The blog post you referenced clearly states that this is output only and does not integrate Silverlight UT with Visual Studio Team Testing System. It will simply output into a TRX format that can then be opened in that window within Visual Studio. You still cannot run your Silverlight tests from a vsmdi, you will need to run them from within the web browser test harness.
I agree it would be great if the tests would run from the "Run All Tests in Solution" button, but that is not possible with the current tools today.
I have written a blog post about how to get the Silverlight Testing Framework to output the Visual Studio "TestResults.trx" log files. I couldn't find anything about how to do this anywhere else.