title: Comparing against DataTable row value
body: <p>I'm needing to create a unit test for a new method I have created. Right now, I'm having an issue comparing my actual result with my desired result.</p>
  
  <p>The method in question is:</p>
  
  <pre><code>public DataTable UniformDateFormat(DataTable durations, string targetColumn)
  {
  
      foreach (DataRow row in durations.Rows)
       {
           if (row[targetColumn].ToString().Length &gt; 0)
            {
                DateTime conv = DateTime.Parse(row[targetColumn].ToString());
            }
       }
  
       return durations;
  }
  </code></pre>
  
  <p>This method is simply checking for a specific column and then converts the date value found within each cell of the column (it's an excel sheet) and converts them to something more uniform.</p>
  
  <p>My test code for it is this:</p>
  
  <pre><code>DataTable table = new DataTable();
  table.Columns.Add("Reporting Date");
  
  table.Rows.Add("12-06-2007");
  test = new DurationData(excelConfig);
  
  foreach (DataRow row in table.Rows)
  {
      result = row["Reporting Date"].ToString();
  
  }
  // the test I want to run
  if (table.Columns.Contains("Reporting Date"))
  {
       result = test.UniformDateFormat(table, "Reporting Date").ToString();
       Assert.AreSame("2007-06-12", result);
       Console.Write("here");
  }
  </code></pre>
  
  <p>When I run this test code I get the following output:</p>
  
  <blockquote>
    <p>Message: Expected: same as "2007-06-12" But was: string.Empty</p>
  </blockquote>
  
  <p>What do I need to modify in order to run my test properly? </p>