Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Tests don't fail when MSTest initialize function is incorrect
samholder
#1 Posted : Friday, November 16, 2012 3:40:40 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/11/2012(UTC)
Posts: 94

Thanks: 28 times
Was thanked: 12 time(s) in 12 post(s)
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.
Remco
#2 Posted : Friday, November 16, 2012 10:41:39 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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
1 user thanked Remco for this useful post.
flynn on 7/5/2013(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.038 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download