nunit-core team mailing list archive
-
nunit-core team
-
Mailing list archive
-
Message #00981
[Bug 629661] [NEW] Theory and Datapoints
Public bug reported:
We should avoid usinge the mechanism for parameterized test in theories.
The following example has "exploding" combinatorical parameters. To
avoid this, we must use ValueSource.
[Datapoints]
public double[] as = new double[] { 0.0, 1.0, -1.0, 42.0 };
public double[] bs = new double[] { 0.0, 1.0, 100.0 };
[Theory]
public void Add(double num1, double num2)
{
Assert.That(num1 + num2 == num2 + num1);
}
But it might be nicer if we really can avoid it using a new attribut Use:
[Theory]
public void Add([Use(as)] double num1, [Use(bs)] double num2)
{
Assert.That(num1 + num2 == num2 + num1);
}
** Affects: nunitv2
Importance: Undecided
Status: New
** Tags: attribute datapoint feauture theory use
--
Theory and Datapoints
https://bugs.launchpad.net/bugs/629661
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
Status in NUnit V2 Test Framework: New
Bug description:
We should avoid usinge the mechanism for parameterized test in theories. The following example has "exploding" combinatorical parameters. To avoid this, we must use ValueSource.
[Datapoints]
public double[] as = new double[] { 0.0, 1.0, -1.0, 42.0 };
public double[] bs = new double[] { 0.0, 1.0, 100.0 };
[Theory]
public void Add(double num1, double num2)
{
Assert.That(num1 + num2 == num2 + num1);
}
But it might be nicer if we really can avoid it using a new attribut Use:
[Theory]
public void Add([Use(as)] double num1, [Use(bs)] double num2)
{
Assert.That(num1 + num2 == num2 + num1);
}
Follow ups
References