Pex - Automated Whitebox Testing for .NET : Unit Test Frameworks Integration

Unit Test Frameworks Integration


Pex was designed to integrate seamlessly into test frameworks based on Custom Attribute, such as MSTest, NUnit, MbUnit, ....
This means that Pex generates test cases that are annotated with the specific attributes of any of those test frameworks.

  • Test classes and Pex classes can be identical. The Parameterized Unit Tests can live side-by-side with other unit tests inside the test fixture:
[TestClass] // this class contains unit tests
public partial class MyTestFixture {
    // this is a unit test
    [TestMethod]  
    public void UnitTest() {...} 
 
    // this is a parameterized unit test
    [PexMethod]  
    public void ParameterizedTest(int i) {...} 
 
    // this is a generated unit test
    // from ParameterizedTest
    [TestMethod, ...]
    public void ParameterizedTest_1() { 
        this.ParameterizedTest(0); 
    }
} 


See Also

TestClassAttribute, PexClassAttribute
(c) Microsoft Corporation. All rights reserved. pex Wiki Documentation 0.93.50813.0