Take the 2-minute tour ×

i have installed Academic version of pex and roles .

I wrote the following code in Visual Studio 2010.but pex just gave a null pointer as the input. doesn't the pex support the class type? please help me.

the test inferface is Test.

source code:

public class ClassForPex

public int a;
public int b;
ClassForPex(int x, int y)
    a = x;
    b = y;

public static class StringExtensions

public static int Test(ClassForPex cjh)
    if (cjh.a > cjh.b)
        return cjh.a;
        return cjh.b;
share|improve this question
add comment

1 Answer

You'll need to use a factory for supplying your ClassForPex instances to the tests. Look at this article to see how to do that.

Using of Factory in Pex - http://developers.de/blogs/damir_dobric/archive/2009/04/13/using-of-factory-in-pex.aspx

share|improve this answer
add comment

Your Answer


