Hi BZ,
Let me try to clarify again: at the moment you decided to use
Combinatorial, you could no longer use
TestCase/TestCaseSource/TestCaseData.
The choice is between...
1) Creating combinations yourself
2) Having NUnit create combinations
Choosing #2, then NUnit will create test cases, using it's internal
equivalent of TestCaseData to do so.
So, your choice is now between ValuesAttribute and
ValueSourceAttribute. Here is a perfectly good example using
ValuesAttribute...
[TestFixture]
public class ExceptionHandlingTests
{
[Test, Combinatorial]
public void GainSetdouble(
[Values(Gain.Red, Gain.Blue, Gain.Green] Gain g,
[Values(2.0, 1.0, 0.0)]
{
vfucam.GainSet(g, d);
}
}
This, of course, does not solve your problem with multiple cameras,
but it would be your starting point, rather than the approach using
TestCaseData, _if_ Nunit is going to create all the combinations. From
this, you could move on to ValueSource and put some intelligence into
the selection of parameters, as you have tried to do.
Here is your basic choice, expressed in simple form...
1) Use ValueSource and make the generation of arguments dependent on a
camera selected at a higher level. Let NUnit combine them.
2) Use TestCaseSource and generate pairs of arguments dependent on a
camera selected at a higher level. NUnit doesn't need to combine args
because you have already done it.
The "higher level" I refer to in both cases has to be completely
outside your tests. This is because the arguments are generated long
before your tests are even executed. It could be something as simple
as setting an environment variable before running the tests.
When we talk about "dynamic" tests in NUnit, we mean test cases that
are _not_ generated in advance but at the time of executing the tests.
That's what you are really looking for but, unfortunately, it doesn't
exist. It's a feature planned for NUnit 3.0.
Charlie
>> >
nunit-discus...@googlegroups.com.
> --
> You received this message because you are subscribed to the Google Groups
> "NUnit-Discuss" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/nunit-discuss/-/RnG0VQKY7fgJ.
>
nunit-discus...@googlegroups.com.