title: Data driven testing in C# using arrays
body: <p>I have a test method which takes two XML files as input and compares them. I am using <code>Microsoft.VisualStudio.TestTools.UnitTesting</code> framework on <code>.NET 4.5</code>. I want to modify the test method such that it takes multiple XML files (two at a time in pair), runs the test and gives the results separately. </p>
  
  <p>I tried the following code but it only gives one single output and stops when any pair of input files fails the test.</p>
  
  <pre><code> string[] source = {file1, file2, file3, file4....};
   string[] target = {fileA, fileB, fileC, fileD....};
  
   [Test Method]
   public void TestCase01()
   {
        TestLogic testObj = new TestLogic(); //class containing the comparison method
        for (int i = 0; i &lt; source.Length; i++)
        {
              Assert.IsTrue (testObj.VerifyFiles(source[i], target[i]));
        }
   }
  </code></pre>
  
  <p>Upon doing some research I found out that <code>DataSource</code> attribute can be used. But I do not know how to pass two arrays (or a single two dimensional array) to the <code>DataSource</code> attribute.
  I would prefer to use <code>Microsoft.VisualStudio.TestTools.UnitTesting</code> for testing and other 3rd party frameworks like <code>NUnit</code> only as a last resort.</p>
  
  <p><strong>Edit:</strong>
  I do not know the number of input files. I used 4 files just as an example.
  Before passing the files to the TestMethod, I pair them using their IDs. So I first read two set of files from two different folders, pair them based on their ID and then pass the paired files to the test case for testing. The way I am doing it now is that I save the paired file names (source and target) in an array or list and then pass them to the test case. Obviously this method is not working and I am experiencing the problem as mentioned above.</p>