views:

15

answers:

0

It seems to me that when there is just a single class in an assembly that has a generic constraint, unit tests in the VS 2010 unit test framework do not work for the complete assembly.

Compilation of the unit test assembly leads to an error. This was a known bug in 2008, but it seems to occur - at least for me - still in 2010 RTM bits. There is a ticket for that at MS:

http://connect.microsoft.com/VisualStudio/feedback/details/324473/cannot-build-a-test-assembly-if-even-a-single-generic-type-has-a-constraint

Sadly, this turns the MS unit test framework simply unusable for me for large parts of my current projects. Simply because most assemblies have somewhere a generic type that HAS some constraint. Well, not all assemblies, but the ones I mostly need unit tests for - the core framework assemblies.

Anyone has an idea how to work around that? Preferably in a way that still publishes unit test results to the TFS 2010 databases and maintains integration?

Currently I am left with no working unit tests for a large proejcts main core library ever since adding a constraint to a generic collection class ;(