Today I was setting up Unit Tests for BizTalk 2009 Schema and Maps.  I was using the BizTalk Server 2009 help guide example as a reference. 

I ran into the following error message:

<Class Name> does not contain a definition for ‘ValidateInstance’ and no extension method ‘ValidateInstance’ accepting a first argument of type <Class Name> could be found (are you missing a using directive or an assembly reference?

This looked like this inside Visual Studios 2008:

 

This was caused by the referenced Schema project not being marked to Enable Unit Testing.  This setting can be found under the Product Properties.

Just simply change this to true, rebuild the Schema and Maps Projects, and the Unit Test methods should now be able to find the ValidateInstance or other missing methods method.

When Unit Testing BizTalk 2009 Map projects, the ValidateOutput method may not be found.  While I did not have problems with creating mapping unit test the solution would be the same.

Enjoy.