NCover Initial Use results
Refer to the following articles to learn how to use them.
http://blog.csdn.net/haibo1228/article/details/4291890
NCover version NCover-1.5.8
Download Address: Http://downloads.ncover.com/NCover-1.5.8.zip
--------------------------------------------------------
The test code is as follows:
C # code
Using System; Using System.Collections.Generic; Using System.Text; Namespace Ncover_helloworld { class program {public static String getdata_a () { return " 00001 "; } public static String GetData () { return ' Hello world! '; } static void Main (string[] args) { Console.WriteLine (args). Length); if (args. Length > 0 && args[0]. ToLower ()--"a") { Console.WriteLine (getdata_a ()); } else { Console.WriteLine (GetData ()); } }} }
--------------------------------------------------------
The test results are as follows:
C:\Program files\ncover>ncover.console "Ncover_helloworld.exe" a
Ncover.console v1.5.8-code Coverage analysis for. net-http://ncover.org
Copyright (c) 2004-2006 Peter Waldschmidt
Command:NCover_HelloWorld.exe
Command Args: "A"
Working Directory:
Assemblies:
Coverage Xml:Coverage.Xml
Coverage Log:Coverage.Log
Waiting for profiled application to connect ... Connected
Configuring Profiler ...
Program Output *******************
1
00001
End program Output *****************
C:\Program files\ncover>ncover.console "Ncover_helloworld.exe"
Ncover.console v1.5.8-code Coverage analysis for. net-http://ncover.org
Copyright (c) 2004-2006 Peter Waldschmidt
Command:NCover_HelloWorld.exe
Command Args:
Working Directory:
Assemblies:
Coverage Xml:Coverage.Xml
Coverage Log:Coverage.Log
Waiting for profiled application to connect ... Connected
Configuring Profiler ...
Program Output *******************
0
Hello World!
End program Output *****************
--------------------------------------------------------
This runs two times, after each run, open coverage.xml to see the code coverage.
--------------------------------------------------------
There is a problem, if the program more complex, how to measure coverage?
--------------------------------------------------------
Another, only find the source of 1.0.1
Http://nchc.dl.sourceforge.net/project/ncover/ncover/ncover-1.0%20RC2/ncover-1.0.1.zip