title: Would a Unit Test add any value to this example of a DAL provider beyond an Integration Test?
body: <pre><code>public List&lt;int&gt; GetPortfolioList()
  {
      using (var connection = new SqlConnection("&lt;connectionString&gt;"))
      using (var command = new SqlCommand("SELECT * FROM Portfolio", connection))
      {
          connection.Open();
          var portfolioTable = SqlHelper.GetDataTable(command);
          var portfolios = from DataRow row
                              in portfolioTable.Rows
                              select int.Parse(row["Portfolio"].ToString());
  
          return portfolios.ToList();
      }
  }
  </code></pre>
  
  <p>Take this method in a SQL DAL provider to retrieve a list of portfolios, as the name (and code) suggests. Because the database table for integration testing contains a fairly static set of data we can Assert against several expectations. e.g. The list of portfolios will:
  - not be empty
  - contain certain known values
  - contain no duplicates</p>
  
  <p>Following a peer review, someone insisted that this code isn't being properly tested (in isolation) because it relies on database access. In the case that most of the value is found in ensuring that this method returns data from a database whose state is guaranteed, I've been unable to see the value in mocking away the database call in order to write a unit test for this method. Am I missing something?</p>