How can I annotate my MBUnit test with a test data source attribute like in NUnit:
Pseudocode like its in NUnit:
[TestCaseSource("GetData")]
public void Test(int value)
{
}
private static IEnumerable<int> GetData()
{
yield return 1;
yield return 2;
yield return 3;
}
MbUnit supports a variety of test data sources using attributes. Refer to MBUnit documentation wiki.
Your NUnit example can be reimplemented in MBUnit using following syntax:
[TestFixture]
public class SampleFixture
{
public IEnumerable<int> GetData()
{
yield return 1;
yield return 2;
yield return 3;
}
[Test, Factory("GetData")]
public void Test(int value)
{
}
}