I need to do something like this:
[TestCase(1, 0, TestName = "Small values")]
[TestCase(int.MaxValue, 0, TestName = "Big precision value")]
[TestCase(int.MaxValue, int.MaxValue - 1, TestName = "Big precision and scale values")]
public void Constructor_ThrowNoExceptions_OnCorrectArguments(int precision, int scale,
[Values] bool onlyPositive)
{
Action action = () => new NumberValidator(precision, scale, onlyPositive);
action.Should().NotThrow();
}
I want to have TestName
and two values from testcase and run them for values onlyPositive
: true
and false
.
I have no idea how to do this because code above doesn't work.
I get Method requires 3 arguments but TestCaseAttribute only supplied 2 System.Reflection.TargetParameterCountException
.
If I put true or false in TestCase
, ValuesAttribute
just ignored and stops working.