Create NUnit test cases automatically from Pex
Asked Answered
L

2

1

I need to create the NUnit Test case automatically from my .Net Solution file. Morover this needs to be done , from command line. I heard Pex create test cases automatically. Let know

Lachrymal answered 5/5, 2011 at 11:59 Comment(0)
F
3

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

Foti answered 24/7, 2011 at 20:54 Comment(0)
R
1

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

Rhine answered 7/7, 2013 at 10:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.