MSTest requires that the [ClassInitialize] decorated method is static and has a TestContext parameter, and if this doesn't exist then the tests return an error (though not a failure), at least in teamcity (our build server)
NCrunch doesn't show these issues and still runs the tests. Whilst this might be useful, it also masks potential issues on the build server and so it would be better if NCrunch failed these tests as well.
Build/Test Issues
Tests don't fail when MSTest initialize function is incorrect
Started by samholder on 6,425 views
Remco NCrunch Developer
#3196
16 Nov 2012 22:41 UTC
Hi Sam,
Yes. NCrunch's implementation of MSTest is emulated rather than integrated, which means that issues like this do exist.
The tricky thing is that introducing a version of NCrunch that changes this behaviour may very well cause tests to break for other users who have written tests now relying on this behaviour. The behaviour of MSTest itself is also different between versions - In VS2012, MS rewrote the entire engine and many of the rules and edge cases are different.
I wonder if the best thing to do may be to show a warning of some kind .. I'll note this down for review.
Thanks,
Remco
Yes. NCrunch's implementation of MSTest is emulated rather than integrated, which means that issues like this do exist.
The tricky thing is that introducing a version of NCrunch that changes this behaviour may very well cause tests to break for other users who have written tests now relying on this behaviour. The behaviour of MSTest itself is also different between versions - In VS2012, MS rewrote the entire engine and many of the rules and edge cases are different.
I wonder if the best thing to do may be to show a warning of some kind .. I'll note this down for review.
Thanks,
Remco
Post a reply
Log in to reply.