locked
How to choose Test Frame work using Pex RRS feed

  • Question

  • Hi

    I installed pex acadamic level to check whether working or not. It's working good.

    I wrote one method to test pex as Capitalize as u coded in the samples.

    1st  time it is asked in which framework you need to write test cases (i.e, NUnit,Xunit, pex genrated mbunint v2  like that it asked for several options) , I've chosen pexGenrated.

    Now i want to generate test cases in NUnit how to change from one test cases from pex genrated to NUnit or XUnit.

    Can any one guide me pls  in this scenario .....

    Regards,
    Ravi Vellanki
    Wednesday, December 30, 2009 11:07 AM

Answers

  • Go to Tools -> Options -> Pex -> General and clear the TestFramework field. The next time Pex will execute, it will pop up the dialog asking for your favorite test framework again.

    Jonathan "Peli" de Halleux - Give us your input about Pex!
    • Marked as answer by rvellanki Monday, January 4, 2010 10:30 AM
    Wednesday, December 30, 2009 4:30 PM

All replies

  • Go to Tools -> Options -> Pex -> General and clear the TestFramework field. The next time Pex will execute, it will pop up the dialog asking for your favorite test framework again.

    Jonathan "Peli" de Halleux - Give us your input about Pex!
    • Marked as answer by rvellanki Monday, January 4, 2010 10:30 AM
    Wednesday, December 30, 2009 4:30 PM
  • Peli,

    Thank you very much for the reply. I got it.

    It works well with NUnit framework I got the test cases. some which are failed and some are passed. but the problem here is I'm not able to find the code coverage option. I didn't get the button to check the code coverage.

    I thought this is because of Acadamic level i didn't get the code coverage option. Is it True?

    If not how to get code coverage option to check how much % that the will cover using Pex...

    Thanks in advance.

    -Ravi
    Thursday, December 31, 2009 7:18 AM
  • NUnit does not come with a code coverage tool. You will need to download and install one separately.

    Jonathan "Peli" de Halleux - Give us your input about Pex!
    Thursday, December 31, 2009 3:17 PM
  • Peli,

    I've the following problems.

    1.if i use NUnit frame work, NUnit always showing the following response as out put for the method Capitalize what you have given as the sample method.

    launching pex
    starting...
    D:\PexTest\PexTest\bin\Debug\PexTest.dll
    "C:\Program Files\Microsoft Pex\bin\Microsoft.Pex.exe" D:\PexTest\PexTest\bin\Debug\PexTest.dll /membernamefilter:M:Capitalization! /namespacefilter:PexTest! /typefilter:Class1! /explorationreflectionmode:Wizard /x64failsilently /assemblyresolutiondirectories:"C:\Program Files\NUnit 2.5.2\bin\net-1.1\lib" /targetclrversion:v2.0.50727 /targetclrversion2 /donotopenreport /reportlevel:None /reportrootpath:D:\PexTest\PexTest\bin\Debug\reports /testassemblyname:PexTest.Tests /testframework:NUnit /testlanguage:cs /testprojectfile:D:\PexTest\PexTest\PexTest.csproj /testprojectnotupdate /testprojectskip
    using waiting pex process
    waiting for monitored process
    listening to monitored process (warm start)
    [reports] recycling reports in background
    00:00:00.0> starting execution
      00:00:00.0> reflecting tests

        !error! [metadata] could not resolve method System.Void NUnit.Framework.TestFixtureAttribute..ctor()

        !error! [reflection] method System.Void NUnit.Framework.TestFixtureAttribute..ctor() could not be resolved. Please ensure that the assembly containing this metadata element is properly referenced at method System.Void NUnit.Framework.TestFixtureAttribute..ctor()

        !warning! [metadata] no explorations found after applying all filters; did you forget a [PexClass] or [PexMethod] attribute?

    00:00:00.8> [finished] execution time 00:00:00.7655368.
        -- 0 critical errors, 2 errors, 1 warnings.
        -- 0 generated tests, 0 failing, 0 new, 0 inconclusive.

    [coverage] skipping coverage reports...
    [reports] skipping html reports

      EXPLORATION FAILED


    monitored process exited with could not find any test to run (-1013)
    finished

    Exit Code NoExplorationFound


    This error occurs when Pex could not find an appropriate method to explore.

    Common reasons for this error are:
    • The intended target method is not visible .
    • The intended target method is not defined in a visible class.
    • The intended target method is defined in an abstract class.

    If you are running Pex on a method in a test project, please make sure that the target method has the attribute PexMethod , and that it is defined in a PexClass .

    • Value : -1013



    path of my NUnit frame work is C:\Program Files\NUnit 2.5.2\bin\net-2.0 i don't know whether it is right path or not? Should i give NUnit.exe path or library or framework or tests path if i use nunit framework? which one is the correct path?

    2. I wrote methods that takes structure as input parameter and returns out put as a structure. May i know how it generates? I mean whether i've to generate parametrized test cases?

    Please help me out.

    Thanks in Advance.
    Tuesday, February 2, 2010 10:18 AM