> I guess I should be asking this in the Contracts forum.
I think that would be a good idea.
For now, to generate test cases with Pex, your best bet currently is to use moles to detour all calls to that method, and then in the attached delegate you can write assertions on the incoming argument values, choose a value to return, and write assumption on that outgoing value.
But in any case, I think you came up with a nice idea to use code contracts to specify (stateless) the assumed/guaranteed behavior of external methods; if code contracts would allow that, Pex could leverage that to automatically mole external methods.
Thanks
Nikolai Tillmann -
Tell us how you use Pex