[NUnit 2.5.7]
I have some test-assembly specific setups via [SetUpFixture], but the [SetUp] method in this class is never marked as covered.
Is this expected behavior or is it a bug?
In my case I have the class in the assembly's root namespace so it should be 1-time setup for all tests in that assembly.
p.s. When altering the setup in this class tests are not re-run with setting "run impacted tests automatically", but explicitly running test which is dependent on that setup code causes it to fail, so the setup method is indeed run d.s.
Thanks.
Build/Test Issues
No coverage for [SetUpFixture] class (NUnit)?
Started by GreenMoose on 6,756 views
Remco NCrunch Developer
#3013
19 Oct 2012 08:01 UTC
NCrunch relies on normal NUnit logic to always call the code in SetUpFixtures, so the code will be run. However, as NCrunch doesn't have a test to actually represent the SetUpFixture itself, it won't record any code coverage for this path of execution.
So in short, this is a known issue. Most likely it will need to be resolved as part of a longer term plan - perhaps by introducing the concept of a SetUpFixture 'test' to hold the coverage.
Thanks for taking the time to report this!
Cheers,
Remco
So in short, this is a known issue. Most likely it will need to be resolved as part of a longer term plan - perhaps by introducing the concept of a SetUpFixture 'test' to hold the coverage.
Thanks for taking the time to report this!
Cheers,
Remco
Just for follow up since this issue is still biting me. Another coverage tool I am using does indeed cover these classes (due to other coverage "calculation logic"?) so it's a bit pity I can't use NCrunch for these scenarios to ensure 100% coverage (except for excluding those classes from metrics that is).
Remco NCrunch Developer
#3191
15 Nov 2012 20:05 UTC
Thanks for your feedback. It's quite a significant adjustment to change the way that this works, so I'm afraid that no changes in this area will be released as part of a minor revision. If this feature is changed, it will likely be in V2 or beyond.
Cheers,
Remco
Cheers,
Remco
Post a reply
Log in to reply.