I have the following method which generates a set of test cases!
public IEnumerable PrepareTestCases(param1)
{
foreach (string e
I've made a change for this in the latest version of nunit which is about to be released (3.2).
https://github.com/nunit/nunit/blob/4f54fd7e86f659682e7a538dfe5abee0c33aa8b4/CHANGES.txt
- TestCaseSourceAttribute now optionally takes an array of parameters that can be passed to the source method
It is now possible to do something like this
[Test, Category("Integration"), TestCaseSource(typeof(MyDataSources),"PrepareTestCases", new object[] {param1})]
public void TestRun(ResultsOfCallMyMethod testData)
{
// do something!
}
private class MyDataSources
{
public IEnumerable PrepareTestCases(param1)
{
foreach (string entry in entries)
{
yield return callMyMethod(param1);
}
}
}