Wednesday, 3 June 2009

First pass at Pex

I have a class that I need to serialize out for remoting which has information about an order with addresses, payment details and order items.

This object will be sent to a message queue and deserialized before process into out MS Dynamics Nav database.

The first thing I did was download the latest version of Pex and get the class to build. Once this was done I ran the Pex explorations and encountered an error ‘failed to generate project CSharp\Test\’ the post explains about file path lengths and how to get passed this. It’s a bit confusing here as this was my home machine and it’s not difficult to move solutions around but I think it my be more tricky on the dev box at work where paths can be long as projects can be nested quite deeply. This has also caused Reshaper to throw exceptions as well so it is something to watch out for.

So what happened next – well everything went smoothly and Pex found that I was missing an entry in my app.config. True – i had copied the code over but not the solution so I had missed the app.config even though everything built. A .stubx file is built by default for the class under test.

It is worth pointing out that I had seen previous demos of Pex at DDD7 and read through, though so far not in great detail the documentation.

I’ll go through the other tests tomorrow.

No comments: