title: Unit Test protected method of an abstract class
body: <p>I'm trying to write a unit test to test a protected method in an abstract class.  I've tried writing a test class that inherits from the abstract class, but when I instantiate the test class the base abstract class attempts to connect to an Oracle database and fails which doesn't allow me to test the protected method I'm interested in.  The abstract class cannot be modified.</p>
  
  <p>How can I directly unit test a protected method in this abstract class?</p>
  
  <p>Here is snippet of what I tried with reflection.  </p>
  
  <pre><code>Type type = typeof(AbstractClass);
  BindingFlags eFlags = BindingFlags.Instance | BindingFlags.NonPublic;
  MethodInfo myMethod = type.GetMethod("ProtectedMethod", eFlags);
  object[] arguments = new object[] { _myDs };
  myMethod.Invoke(type, arguments);
  _myDs = (DataSet)arguments[0];
  </code></pre>