I'm developing some custom tasks and would like to write some Unit Test cases to make it easier to test them during development. The only problem I've run into thus far is logging. Because I'm not setting the BuildEngine property on my task before calling Execute(), all of the Log statements throw exceptions. I haven't been able to locate any information on how to go about setting this property. Any help would be appreciated. Thanks.
Derek

Unit Tests for Custom Tasks
Jaimi
Patrick Grimme
Derek Greer
Ivan Starr
Derek
We frequently encounter the same situation when developing tasks, and our solution to it is to use a stubbed out class that implements IBuildEngine, and then set that as the BuildEngine on the task.
If you are interested, one of the recent MSBuild Extras we put out there has the binaries for the MockEngine type that you can use, instead of building one from scratch on your own. You can find the AssemblyInfo task here http://www.gotdotnet.com/codegallery/codegallery.aspx id=93d23e13-c653-4815-9e79-16107919f93e - and that has unit tests that show how this approach was used.
Hope you find this helpful.
Thanks.
Faisal Mohamood