none
How can intelliTest do full code cover RRS feed

  • 问题

  • I use intelliTest and found that is very difficulty for me to full code cover a method.So I write some test code:


      public class InstanceA
      {
            private int[] m_int;
    
            public void Func2()
            {
                
            }
    }

    yes,just simple code, and then I create intelliTest and run for the "Func2".IntelliTest show 1/3 blocks covered. I can not understand, I have do nothing in the Func2, so where is the two uncoverd blocks?If I declare m_int with "int" not "int[]", IntelliTest show 1/1 blocks.What happened with intelliTest exploration?


    2017年4月17日 13:12

全部回复

  • maybe need initial m_int

    http://feiyun0112.cnblogs.com/

    2017年4月18日 1:09
    版主
  • 谢谢回复,我尝试过各种初始化,包括构造函数初始化,声明时直接初始化(包括了数组长度0,数组长度n,直接初始化赋值数组各个元素),声明一个Set函数(无参,函数内部初始化),都没有用,已经会显示两个block无法覆盖,只有我把m_int声明为public,才会显示1/1,其他都是1/3,感觉对intelliTest的机制非常无语
    2017年4月18日 2:00
  • 我写了方法测试了一下是可以的,但是用你的代码也会出现相同的错误。


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    2017年4月19日 10:51