Take the 2-minute tour ×  I'm near the beginning of a new
project and (gasp!) for the first time ever I'm trying to
include unit tests in a project of mine.  I'm having trouble
devising some of the unit tests themselves. I have a few methods
which have been easy enough to test (pass in two values and
check for an expected output). I've got other parts of the code
which are doing more complex things like running queries against
the database and I'm not sure how to test them.  public
DataTable ExecuteQuery(SqlConnection ActiveConnection, string
Query, SqlParameterCollection Parameters)     DataTable
resultSet = new DataTable();     SqlCommand queryCommand = new
SqlCommand();         queryCommand.Connection =
ActiveConnection;         queryCommand.CommandText = Query;
if (Parameters != null)             foreach (SqlParameter param
in Parameters)          SqlDataAdapter queryDA = new
SqlDataAdapter(queryCommand);     catch (Exception ex)
//TODO: Improve error handling      return resultSet;  This