title: Unit test MSBuild Custom Task without "Task attempted to log before it was initialized" error
body: <p>I have written a few MSBuild custom tasks that work well and are use in our CruiseControl.NET build process.</p>
  
  <p>I am modifying one, and wish to unit test it by calling the Task's Execute() method. </p>
  
  <p>However, if it encounters a line containing </p>
  
  <pre><code>Log.LogMessage("some message here");
  </code></pre>
  
  <p>it throws an InvalidOperationException:</p>
  
  <p><em>Task attempted to log before it was initialized. Message was...</em></p>
  
  <p>Any suggestions? (In the past I have mostly unit-tested Internal static methods on my custom tasks to avoid such problems.)</p>