Skip to content

TestCaseSource unable to pass one element byte array#2310

Merged
rprouse merged 1 commit intonunit:masterfrom
Stan-RED:fixes/issues-1851
Jul 12, 2017
Merged

TestCaseSource unable to pass one element byte array#2310
rprouse merged 1 commit intonunit:masterfrom
Stan-RED:fixes/issues-1851

Conversation

@Stan-RED
Copy link
Copy Markdown
Contributor

@Stan-RED Stan-RED commented Jul 9, 2017

While working on #2104 I have also optimized TestCaseSourceAttribute and additionally check it against this issue. Looks like it is fixed.

Fixes #1851

args = new object[array.Length];
for (int i = 0; i < array.Length; i++)
for (var i = 0; i < array.Length; i++)
args[i] = array.GetValue(i);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

array.CopyTo(args, 0); is also an option.

[Test, TestCaseSource("MyArrayData")]
public void SourceMayReturnArrayForArray(int[] array)
{
Assert.That(true);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assert.Pass(); or an empty method body are also options.

@rprouse rprouse merged commit 1a3c728 into nunit:master Jul 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TestCaseSource unable to pass one element byte array

3 participants