-
-
Notifications
You must be signed in to change notification settings - Fork 835
Closed
Labels
BugA fault in an existing featureA fault in an existing featureCore frameworkxunit.v3.corexunit.v3.core
Description
I still experience this issue in v2.9.2 when using the ClassData attribute with a class derived from TheoryData.
See the modified example with the exceptions next to the Add calls.
[Theory]
[ClassData(typeof(ExampleParameters))]
public void ExampleParameterizedTestMethod(string[] values)
{
Assert.All(values, s => Assert.True(s.Length < 10));
}
private sealed class ExampleParameters : TheoryData<string[]>
{
public ExampleParameters ()
{
Add(new string[] { "0" }); //System.ArgumentException: Object of type 'System.String' cannot be converted to type 'System.String[]'.
Add(new string[] { "0", "2" }); //System.InvalidOperationException: The test method expected 1 parameter value, but 2 parameter values were provided.
Add(new string[] { "0", "2", "4" }); //System.InvalidOperationException: The test method expected 1 parameter value, but 3 parameter values were provided.
}
}Originally posted by @afuersch in #3031 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA fault in an existing featureA fault in an existing featureCore frameworkxunit.v3.corexunit.v3.core