Ncover, mbunit, ccnet

Source: Internet
Author: User
Ncover, mbunit, ccnet

Ncover and mbunit play very nice togther, either from the command line, td.net or ccnet.

From the command line its

Ncover. Console mbunit.cons.exe myassembly. dll

Don't forget the. exe, this assumes all the paths to the various thig are mapped but if not

C: "Program Files" ncover "ncover.console.exe C:" Program Files "mbunit" mbunit.cons.exe myassembly. dll

If your using td.net then simply use the right click and test with coverage option inside your unit test, it works just as well with mbunit

If your using ccnet then you have a little more to do.

First alter your msbuild or Nant file so that your unit tests are run from the mbunit. Cons (using an EXE task) and not the mbunit task. If your using msbuild then its something like

<Exec workingdirectory = "unitests" bin "debug" "command =" C: "progra ~ 1 "ncover" ncover. console mbunit.cons.exe/rnf: unittest/RT: XML/RF: C: "ccnet" server "test" artifacts unittests. DLL // x C: "ccnet" server "test" artifacts "ncover. XML "/>

Note the working directory, this where your unittest assembly will be located. Note the use of progra ~ 1 As program files is not undertsood by ccnet. note that/rnf is the name of your UniTest Report and/RT: indicates its an XML file. note that we use // X to output the ncover XML to the ccnet directory and/RF: to do the same for mbunit.

When thats working for you, edit your ccnet file to merge the outputs



C: "ccnet" server "test" artifacts "ncover. XML
C: "ccnet" server "test" artifacts "unittest. XML
C: "ccnet" server "test" artifacts "msbuild-results.xml

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.