Reputation: 24422
I'm running dotCover coverage in Teamcity. After the build it constructs the coverage report in which you can drill down to individual class coverage.
I have a class containing 1 method that produces the following summary.
Class, %
100% (1/1)Method, %
86.7% (13/15)Statements, %
91.7% (55/60)
Class and statement results seem straight forward but I can't see how to interpret the method result.
What have I got 15 of (of which 13 are covered)?
Update
Here is the gist of the class
public static class MyClass
{
public static List<B> Bye(X x, B b)
{
List<B> bList = new List<B>();
if (x is A)
{
// Do something
}
else if (x is B)
{
// Do something else
}
if (b.Something)
{
x.Where.ToList().Foreach(x => x.Work());
}
if (b.Something)
{
x.Where.ToList().Foreach(x => x.Work());
}
if (b.Something)
{
x.Where.ToList().Foreach(x => x.Work());
}
if (b.Something)
{
x.Where.ToList().Foreach(x => x.Work());
}
if (b.Something)
{
x.Where.ToList().Foreach(x => x.Work());
}
if (b.Something)
{
x.Where.ToList().Foreach(x => x.Work());
}
if (b.Something)
{
x.Where.ToList().Foreach(x => x.Work());
}
return bList;
}
}
Upvotes: 3
Views: 676
Reputation: 8368
I would say it was 13 of 15 methods covered (or at least one statement executed in each method marked as covered/visited). If you can't see all the methods then remember that get/set of properties are also methods; they may also include the default constructor in that figure but I would have though it unlikely.
For most coverage tools I've used, I use statement coverage as my main value and method coverage(visited) next.
Upvotes: 1