Get started with Microsoft IntelliTest

Important attributes

using Microsoft.Pex.Framework;

[..., PexClass(typeof(Foo))]
public partial class FooTest {
    public void Bar([PexAssumeNotNull]Foo target, int i) {
[assembly: PexAssemblyUnderTest("MyAssembly")] // also instruments "MyAssembly"
[assembly: PexInstrumentAssembly("Lib")]

Important static helper classes

  • PexAssume evaluates assumptions (input filtering)
  • PexAssert evaluates assertions
  • PexChoose generates new choices (additional inputs)
  • PexObserve logs live values to the generated tests
void StaticHelpers(Foo target) {

    int i = PexChoose.Value<int>("i");
    string result = target.Bar(i);

    PexObserve.ValueForViewing<string>("result", result);

Got feedback?

Post your ideas and feature requests on UserVoice.