Pex does not support decimal
So not able to do much this weekend I decided to use Pex to do some testing on a project I am busy on. The class I needed to test was a quote detail line where there is two quantities, of which only one can be specified depending on the property DealerSupplied. Here is the bare properties:
Initially I was guessing that I’d need at least 6 or 7 tests to test these three properties.
So how can Pex help me explore this code?
Well I thought I’d try the following code:
I was a bit surprised when I got only two tests back from Pex. I was even more surprised when I saw the values.
So my first reaction was to shoot of an email to Pex Support. I then tried to use int’s instead of decimal’s.
This gave me a much better result:
Then I got an email from Nikolai, where he confirmed that Pex does not play well with the decimal value type. In his words: ‘all generated tests are bogus’ when using decimal as parameters.