Tagged Questions
0
votes
0answers
18 views
Exclude folders from TFS unittest coverage
Can we customize the unit test coverage figuring way in TFS
We are running Continuous Integration in our team. the key is unittest.
we check in code in TFS, and will trig a build, only reach a ...
4
votes
6answers
2k views
Viewing Code Coverage Results outside of Visual studio
I've got some unit tests, and got some code coverage data. Now, I'd like to be able to view that code coverage data outside of visual studio, say in a web browser. But, when I export the code coverage ...
29
votes
4answers
2k views
Free NCrunch alternative
Since NCrunch has left the free market, I was looking for a similar tool for code coverage marking, and continous testing like NCrunch
edit: I'm using VS2012
5
votes
1answer
5k views
Code coverage test in Visual Studio 2010? How?
I have a simple project on C#.NET and have written it in Visual Studio 2010. I am a newbie in C# and Visual Studio.
I have written some unit tests, and they pass ok, but how can I test code coverage?
...
1
vote
2answers
291 views
OpenCover - how to view coverage per test?
On OpenCover github page I can see that OpenCover supports coverage by test ("Release 3 (coverage by test support, debug symbols"). The issue is, I don't know how to run OpenCover with this option. My ...
123
votes
11answers
31k views
Code Coverage for C#/.NET [closed]
I wonder what options there are for .net (or C# specifically) Code Coverage, especially in the Lower Priced segment?
NCover
Seems to be very popular and looks quite good
Supports statement coverage ...
3
votes
1answer
130 views
MSTest Shows Partial Code Coverage on Compound Boolean Expressions
From Microsoft's documentation, partially covered code is "...where some of the code blocks within the line were not executed." I'm pretty stumped on this one (simplified for brevity):
Given this ...
0
votes
1answer
304 views
sonar with gallio and opencover, code coverage: 0%
I'm using sonar to check my c# project. I would like to measure code coverage that's why i installed gallio and opencover. When I run soner-runner everything works fine, my unit test is performed, ... ...
0
votes
4answers
113 views
Unit testing asp.net mvc controller action tryupdate
I wanna test the controller action, but one point is not coveraged by visual studio Code coverage tool.
public ActionResult Activate(int? id)
{
if (id == null)
return ...
3
votes
1answer
104 views
Code Coverage on a LINQ projection
I have the following lines of codes in my application and I'm not sure why but Code Coverage is telling me that it is not covered:
var filters = from f in request.Filters
select new ...
1
vote
0answers
52 views
Visualize change in test coverage with dotCover and TeamCity
Is there any way to visualize the change in test code coverage in dotCover/TeamCity between two build? Today we are able to see the overall change from the previous build (e.g. 70% -> 70.1%), but ...
0
votes
1answer
39 views
Exclude XSD files from NCover CruiseControl.Net
I want to exclude XSD files from the NCover report generated after build by CruiseControl.
After serching I came across following option from Ncover site
...
0
votes
3answers
62 views
Best way to get an accessable class in all of my projects
I need to declare an attribute for coverage exclusion in my code, the issue is that i have a project group and i wish to create it somewhere where i can access it from all projects when i need it, ...
9
votes
1answer
206 views
Weird test coverage results for iterator block, why are these statements not executed?
I'm using dotCover to analyze code coverage of my unit tests, and I'm getting some strange results... I have an iterator method for which the coverage is not complete, but the statements that are not ...
2
votes
5answers
124 views
What are the good practice to test/inject private field in C#
My apologies if this a duplicate. I have been given the task to add some coverage for the method and been told to mock the private List<string> property. My question is: Is there a way to test ...
18
votes
5answers
12k views
Running NUnit tests in Visual Studio 2010 with code coverage
We have recently upgraded from Visual Studio 2008 to Visual Studio 2010. As part of our code base, we have a very large set of NUnit tests. We would like to be able to run these unit tests within ...
0
votes
1answer
167 views
NCover: Exclude unexecutable line of code from coverage
The switch statement in following code has a default clause that is required by the compiler and a nice safeguard, but which is never executed. After writing tests for everything else, there is no way ...
6
votes
3answers
2k views
OpenCover generates an empty report
I am using OpenCover to determine code coverage for a simple C# project.
The problem
Although I can see MSTest running the unit tests (and succeeding) the generated report is empty.
Details
This ...
14
votes
3answers
8k views
MSTest Code Coverage
Is there a way to test code coverage within visual studio if I'm using MSTest? Or do I have to buy NCover?
Is the NCover Enterprise worth the money or are the old betas good enough if Microsoft ...
2
votes
2answers
347 views
C# Code Coverage with Selenium
Does anyone know of a way to create Code Coverage reports for C#/.NET projects tested via Selenium?
19
votes
3answers
472 views
PostSharp and Visual Studio Code Coverage
I've recently started using PostSharp in some of my projects and have noticed an unfortunate side effect - the code coverage in all the projects its used with drops significantly.
I'm guessing the ...
1
vote
1answer
125 views
Using ExcludeFromCodeCoverageAttribute breaks XML Comment
Im using Visual Studio 2010 with c#.
I'm using XML documentation in my project and successfully added comments.
Successfully means there are noch compilerwarnings about missing XML comments.
Then I ...
1
vote
1answer
149 views
How do I Obtain Code Coverage on Assembly after ExportDll has run it through ildasm/ilasm?
I'm using a post-build step on my C# assembly to expose a function signature from my dll. This step uses the ExportDll tool from http://www.codeproject.com/KB/dotnet/DllExport.aspx. However, if I ...
0
votes
0answers
198 views
Code Coverage analysis for .NET Compact Framework 2.0
Is there any Recommended solution for deriving Code Coverage analysis for .NET CF (Compact Framework), SmartDevice (Pocket PC) applications.
We are using vsinstr +vsperfmon for Desktop Applications.
...
0
votes
1answer
446 views
Visual Studio - ExcludeFromCodeCoverage
I have Visual Studio 2010 Ultimate and C# and am doing unit tests and viewing code coverage. There are some classes I want to exclude from the code coverage, so I read that you can use the
...
1
vote
1answer
159 views
Why is NCover branch coverage 50% even though branch evaluates to both true and false?
In this small piece of code:
public event StabilityChangedHandler StabilityChanged;
267 private void RaiseStabilityChanged()
{
if (StabilityChanged != null)
{
1 ...
1
vote
0answers
170 views
MS Test Code Coverage returning incorrect results
I have written a .Net 4 WPF app in the MVVM pattern and have written several unit tests for the app. I enabled code coverage and enabled instrumentation in the local.testsettings. My issue is that ...
0
votes
2answers
102 views
How can I measure code coverage for background program?
My company is developing database software. Most of that is made of C++ and some part is C#.
The part of C# is a library module.
There is a executable file. aaa.exe and windowClient.dll used by ...
2
votes
1answer
107 views
AssemblyInitialize not measured in Code Coverage
I came across some strange results when using Code Coverage for our unit tests.
In the AssemblyInitialize function we do some initialization work (like AutoMapper, AbstractFactories) and this ...
0
votes
4answers
316 views
analysis of code coverage [closed]
I am working with asp.net web forms project developed in framework 4.0. It does not have any unit tests at present.
I am currently adding a new feature to the site in which I hope to introduce unit ...
0
votes
0answers
208 views
Programmatic Code Coverage Analysis for custom TFS Checkin policy is very slow
I'm working on a custom TFS Checkin Policy to make sure our code coverage is above a certain value. I've found some examples and now I'm trying to get them to work with VS 2010.
Currently I have some ...
2
votes
2answers
62 views
Why is this string property shown to be fully covered when it's not supposed to be?
class Program
{
static void Main(string[] args)
{
var x = new Program();
Console.Write(x.Text);
Console.Write(x.Num);
//Console.Write(x.Num);//line A
}
...
4
votes
2answers
313 views
Turning off Lamba Expressions in Visual Studio 2010 for Code Coverage
When looking at code coverage data with Visual Studio 2010 I see the following output under a given namespace:
SomeClass1
SomeClass2
SomeClass2.< >c__DisplayClass1
SomeClass2.< ...
0
votes
4answers
946 views
Cobertura equivalent available for C# .NET?
Is there a Cobertura (or other code coverage tool) equivalent for C# .NET?
1
vote
4answers
219 views
How can I ignore some unit-tests without lowering the code-coverage percentage?
I have one class which talks to DataBase.
I have my integration-tests which talks to Db and asserts relevant changes. But I want those tests to be ignored when I commit my code because I do not want ...
2
votes
1answer
213 views
DotCover Not giving coverage for refrenced DLL
i donwloaded the dotcover 1.1.1 for evaluation.
We use a automation framework to run regression test where application 'X' refrences application 'Y's DLL .
I need code coverage of application Y when i ...
0
votes
2answers
431 views
Code Coverage with MSpec
Can anyone recommend a free code coverage tool for use with MSpec on VS2010/.NET4? Can TD.NET do this?
0
votes
1answer
404 views
Sonar C# plugin don't take into account 100% covered files
we use the following suite to analyse our .Net4 project:
Maven 2.2.1
Gallio 3.2.750
PartCover 4.0.20626
Sonar 2.9
Sonar C# Plugins Ecosystem 1.0
When we open the coverage report file (build with ...
9
votes
8answers
271 views
How to discover which test unit checks which lines of code?
I was fooling around the NUint, hoping to discover a way to realize which line of code passes in which test.
Imagine I have a method for which I have 3 tests. Is there any way to find out which test ...
2
votes
3answers
506 views
Test coverage tools for MS Test
I have a project in VS 2008 and written a MS Test cases for that. I am looking any open source Test Coverage tools which are free (Like NCover) to perform Test Case coverage tools in .net
Pleaes let ...
0
votes
5answers
458 views
Runtime Code Coverage Tools
I know that there are a number of tools for analysing .NET code and calculating the coverage, plus identifying classes/methods/properties etc that are never going to be hit.
However, I am trying to ...
1
vote
1answer
240 views
No results from Partcover with MSTest
I am trying to get to grips with Partcover for possible integration with a build machine.
I am running Partcover in the command line with the following command:
PartCover.exe --settings settings.xml ...
4
votes
4answers
594 views
What are the most effective (freely available) tools for C# code coverage? [closed]
Visual Studio C# Express edition is an adequate IDE when it comes to writing C# - and NUnit is an adequate framework for writing unit tests. This pairing, however, isn't sufficient to establish the ...
0
votes
2answers
599 views
FileNotFoundException when using Microsoft.VisualStudio.Coverage.Monitor.dll
C# console app with a reference to c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\DataCollectors\x86\Microsoft.VisualStudio.Coverage.Monitor.dll:
using ...
22
votes
4answers
2k views
How do I exclude types and methods from being covered by dotCover in TeamCity 6?
I've got an existing C# 4 project which I've checked the test coverage for by using TestDriven.Net and the Visual Studio coverage feature, i.e. Test With -> Coverage from the context menu.
The ...
3
votes
4answers
853 views
TDD workflow best-practices for .NET using NUnit
UPDATE: I made major changes to this post - check the revision history for details.
I'm starting to dive into TDD with NUnit and despite I've enjoyed checking some resources I've found here at ...
3
votes
1answer
948 views
Code Coverage for xunit
I am maintaining a system where there are some unit test written with xUnit.
I need to bring code coverage to 90% what would be a good way to go about it?
I have used MSTest before and it had a ...
3
votes
3answers
353 views
Does one still write tests with TDD when the desired code has little to no logic? Why?
TDD is supposed to have 100% code coverage. Does this mean one is supposed to write tests for property getter and setters, and other methods that contain no real logic, such as dealing with external ...
2
votes
2answers
432 views
How can I exclude lambda functions in properties from code coverage?
I am trying to gather some good code coverage stats for my C# application, but I would like to ignore the generated SubSonic classes as there is no real point in gathering code coverage statistics for ...
5
votes
6answers
278 views
.net - Howto analyze how many different code paths are in a method
Is there a (preferred free) tool that can analyze how many different combinations are possible in a method? I am currently refactoring a method that has many many if/switch statments and I am curious ...