How Do You Configure Pex to Respect Code Contracts?

Given the following example code, how can I configure Pex to respect my Code Contracts?

    public static IEnumerable Administrators(this UserGroup userGroup)
    {
        Contract.Requires(userGroup != null);
        Contract.Requires(userGroup.UserList != null);

        return userGroup.UserList.Where(ul => ul.IsAdmin == true);
    }

Current Problem: When I run Pex, it's still generating test cases which violate the specified code contracts.

FYI: Here are the 'Code Contracts' settings in my csproj file.


EDIT: Did something break in SP1?

7
задан Community 23 May 2017 в 11:47
поделиться