title: Can I create a SqlDataReader and provide it with values without having to return a SqlDataReader from another object e.g. SqlCommand.ExecuteReader()
body: <p>I am writing unit tests for my data access layer. To achieve this I have created a wrapper for SqlCommand (ISqlCommand) so that I can mock its functionality.</p>
  
  <pre><code>ISqlCommand command = _connection.GetSqlCommand(sqlCommand);
  </code></pre>
  
  <p>In one of the methods I am testing, SqlCommand's ExecuteReader method is being called and I have to return a SqlDataReader.</p>
  
  <pre><code>SqlDataReader reader = command.ExecuteReader(CommandBehavior.SingleRow);
  </code></pre>
  
  <p>In this same method reader.Read will get called</p>
  
  <pre><code>if (reader.Read())
  {
      someVariable = reader.GetString(1);
  }
  </code></pre>
  
  <p>What I want is to be able to return a SqlDataReader object from the mocked command.ExecuteReader() with a value present for me to Read. Can it be done? It seems that SqlDataReader can only be instantiated from an actual SqlCommand.ExecuteReader being run and returning a SqlDataReader.
  Full relevant code to be tested.</p>
  
  <pre><code>ISqlCommand command = _connection.GetSqlCommand(sqlCommand);
  
  using (command)
  {
      SqlDataReader reader =  command.ExecuteReader(CommandBehavior.SingleRow);
  
      if (reader.Read())
      {
          dbVersion = reader.GetString(1);
      }
  }
  </code></pre>
  
  <p>EDIT: To clear about what I am asking. SqlDatareader has no public constructor. As far as I can tell I cannot write any tests using that class as I cannot instantiate it without making a legitimate call to a database using SqlCommand. Even trying to create an interface of a SqlDataReaderWrapper will no help me as the problem is the same. I am not trying to write an integration test (making actual calls to a DB) and so the DataReader seems impossible to test as is. My question is, is there anything i can do, to put values into a SqlDataReader in this situation?</p>