Shouldn't NCrunch report this in some way as an error? :
[TestCase(42, "wrong")]
public void TestIt(int i)
{
}
The NUnit testcase has a parameter mismatch. It never executes the test, which has bitten me twice the last week...
This does fail though:
[TestCase("wrong")]
public void TestIt(int i)
{
}
Daily Usage Issues
TestCase with too many parameters does not fail
Started by jjvdgeer on 6,259 views
Remco NCrunch Developer
#11365
13 Oct 2017 23:06 UTC
Hi, can you confirm which version of NUnit and NCrunch you're using here?
I see the message: Too many arguments provided, provide at most 1 arguments.
I see the message: Too many arguments provided, provide at most 1 arguments.
NCrunch is the newest (as far as I'm aware), 3.11.0.9. NUnit is actually pretty old, it's 2.6.3. Maybe I should update NUnit?
Remco NCrunch Developer
#11367
16 Oct 2017 06:51 UTC
This is an error that's being kicked up at discovery time. At this point in the process, error capture and handling is much less sophisticated under NUnit v2. NCrunch recognises that there is a problem with the test, but the error itself isn't reported. The issue here is that NUnit v2 does not have a formal API for test runners, so when things go wrong there is no consistent way to respond to issues.
Fixing this problem isn't really feasible, since NUnit v2 is itself several years out of date now and the nature of its design means that fixing edge cases like this just isn't worth the risk. NUnit v3 has an entirely new adapter with a formal API and error handling that is much better suited to this kind of thing. If this problem is causing you pain, I recommend upgrading to NUnit v3.
Fixing this problem isn't really feasible, since NUnit v2 is itself several years out of date now and the nature of its design means that fixing edge cases like this just isn't worth the risk. NUnit v3 has an entirely new adapter with a formal API and error handling that is much better suited to this kind of thing. If this problem is causing you pain, I recommend upgrading to NUnit v3.
OK. It has been annoying but it will probably take a while before it is annoying again (i.e. before someone manages to put in a test with the wrong number of parameters). :) I don't think there's any good reason why we shouldn't be able to update to NUnit 3, so I'll look into that.
Thanks.
Thanks.
Edited 16 Oct 2017 09:56 UTC
Post a reply
Log in to reply.