3

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;
        }  
    }
4

1 回答 1

1

我会说它涵盖了 15 种方法中的 13 种(或者在标记为已覆盖/已访问的每个方法中至少执行了一条语句)。如果您看不到所有方法,请记住 get/set 属性也是方法;他们可能还包括该图中的默认构造函数,但我会认为它不太可能。

对于我使用过的大多数覆盖率工具,我使用语句覆盖率作为我的主要价值和方法覆盖率(已访问)。

于 2013-07-02T18:18:14.883 回答