开发者

Create NUnit test cases automatically from Pex

I need to create the NUnit Test case automatically from my .Ne开发者_StackOverflow社区t Solution file. Morover this needs to be done , from command line. I heard Pex create test cases automatically. Let know


The following steps should get you there:

  1. Add a reference to Pex.NUnit.dll in your test project
  2. In your test project's AssemblyInfo.cs, add the attribute - [assembly: Pex.NUnit.PexNUnitPackage]
  3. Build your solution (either from Visual Studio or using msbuild from the command line)
  4. run Pex from the command line: pex.exe bin\Debug\TestProjectName.dll
  5. The tests are placed under reports\TestProjecName.#####.#####\tests.

You can read more about this in Exercise 5 of Parameterized Unit Testing with Microsoft Pex


Ryan Gross' answer points to the right direction.

However Pex.exe generates Unit Tests from Parameterized Unit Tests, not from application classes itself.

To generate Parameterized Unit Tests you need to run pexwizard.exe

pexwizard.exe <your assembly name> options

Possible options are described in http://testoriented.googlecode.com/svn-history/r89/suitability/trunk/Tools/Pex-0.22.50128.1/pexwizard.txt

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜