Not often I get the jump on it's old master but MbUnit answers Peli's post on unit testing generics. The 2.4 release added GenericAssert for testing collections that implement generic ICollection<T>.

I have long wanted to add LINQ support to MbUnit collection testing but the lack of supertype contravariance support in the CLR makes this impossible (so for example you can't create a collection assert that takes a LINQ Table object and pass it the result of your LINQ query as it said result can't cast down its supertype). MSR are looking at changing this and it will be interesting to see what the Pex guys add.

1 Comment

  • I'm pleased that someone has noticed the extra documentation :-)

    Now to add some sample code to each page so that we make it even more useful.

    Please let me know if you don't like the layout or I've made any mistakes.


Comments have been disabled for this content.