Pex reuses values

56 views Asked by At

I am using Pex to generate test cases. I have a function that looks similar to the one below:

public void function(List<string> list, List<List<string>> listOfLists){
    // do something with the lists (add values, remove them, ...)
}

However, I recently noticed that sometimes Pex creates test cases where list is one of the values in listOfLists. This behaviour is not possible in my function and I would like to suppress this generation. Is there a way to prevent this from happening?

1

There are 1 answers

0
pvlakshm On

Please use PexAssume (https://msdn.microsoft.com/en-us/library/microsoft.pex.framework.pexassume.aspx) to express any such assumptions or preconditions on the inputs that IntelliTest generates.