With dotCover run one unit test and see code coverage highlighting - code-coverage

I am using dotCover 2.2 with VS 2010 Pro and NUnit 2.6.2 12296.
From dotCover Unit Tests Sessions I can select an individual test, right click and get the option to
"Cover Unit Test with dotCover" which appears to run just the one test, yet does not change the highlighting for the tests not run. I am expecting the code coverage highlighting to be cleared then display only the code coverage highlighting in green for the single test.
While I am able to get dotCover to highlight the code covered by all of the unit test, I would like to run just one unit test and see only highlighted that code which is covered by that unit test.
Is this possible? If so, how?

You need to create a new test session to cover the test with.
You can do this by right clicking the test you want to individually cover and click 'Create New Session' from the drop down. Then when you run your code coverage, it will only create a coverage report from the single test in your new test session.
DotCover stores the coverage results from an entire test session and uses it to display the code highlighting. When you were running the individual test in the existing test session, you were only updating the coverage results in the existing coverage report. By creating a new session, you create an empty coverage report.

Related

Including NUnit TestFixture Name in TFS Test Results

I have a TFS build definition setup to run the task "Visual Studio Test" using the Nunit3 Test Adapter. This runs successfully and publishes test results. However, neither the TestFixture name or the Test's Fully Qualified Name are available in the test reuslts. This makes it difficult to determine what exactly what test failed without using lengthy test names.
Is there a way to include the Test Fixture names in the published test results from the build?
Please refer to the Tests summary tab of your build. It shows the detail information of test results of your Nunit3 tests.
You could use the Filter to find out those Failed or Succeeded tests.
You could also click the link in the picture below to check detail data for this test run.

Single code coverage file for multiple test cases in MTM

I have been assigned to configure code coverage in MTM. I made all the settings and I was able to get it successful.
But one of our requirement says that we need to have single code coverage file for suite / multiple test case execution.
I tried executing multiple test cases by selecting with control key, after executing the test case I'm getting code coverage file for each test case.
For Example: 2 .coverage file for 2 test cases.
Is there any way to have single .coverage file for multiple test cases execution?

Why Xcode 7 shows around 12% code coverage when there are no unit tests at all?

I am working on a project in Xcode for iOS app and I enabled "Gather coverage data" in the "Edit scheme -> Test".
I also created a test target with an empty unit test, the only one in the whole project so far and now when I run the test I can see that around 12% of code has been covered (The project has around 500 files in the project and there are many classes in the coverage report that are displayed as covered).
How is this possible? Did I miss something?
In wiki there is "In computer science, code coverage is a measure used to describe the degree to which the source code of a program is tested by a particular test suite." We have only one test suite and it is empty.
As of Xcode 8, running the tests actually instantiates the app. That means that all the initialization code is executed. This will show as covered code in the test coverage report.

Can Coded UI tests and MTM be used to create a test suite that will automatically play all test cases?

When creating a test suite in selenium ide it is possible to let all test cases in a test suite run in a continuous manner and see results when finished. I'm looking into creating test suites in Microsoft test manager and possibly automating with the code with cuit, my question is, is it possible to run the tests one after another with no manual interaction, as from what I've seen so far, it seems you have to manually verify the test results in each step for MTM tests and manually verify the pass or fail status at the end of the test?
You can create a test case and tie an automated test case (Selenium/CUIT) to it in Visual Studio. This flips a flag in the test case work item to "automated", and allows you to automatically execute those test cases on test agents.
https://msdn.microsoft.com/en-us/library/dd380741.aspx

How do I get Team Build to show test results and coverage for xUnit.net test suite?

Has anybody had any success getting Team Build to show xUnit.net test results and code coverage in the build report? The MSBuild runner is running the tests just fine and the results are in the log file, but the test results and code coverage results areas of the build report say "No test result" and "No coverage result" respectively. Is Team Build looking for a certain location / format for the test results to be exported by the xUnit.net runner?
TFS/TeamBuild definitely requires the test results in a particular format, they also need to be specifically published to TFS as well.
I'm currently looking at this problem for the Gallio test runner, and can offer two potential options:
Try wrapping the xUnit tests inside the 'Generic Test' project type
that VSTS offers - this is where MSTest executes the xUnit test
runner.
Come up with an XSLT transform (or similar) that can map the
xUnit results to the MSTest schema (see
http://www.codeplex.com/nunit4teambuild for an example of this
approach for NUnit tests).
See also http://jonnekats.wordpress.com/2009/05/07/integrate-xunit-tests-into-your-daily-team-build/

Resources