Quick Tip For VSTS Test Project

Just ran into a quick issue that deserved a mention.  I've been experimenting with the Visual Studio Team Suite Test Project lately.  I have an existing solution separated into its layers (Presentation-BLL-DAL-DB).  I recently tried to write a Unit Test using the VSTS Test Project and ran into a bit of a snafu.

I was testing out a BLL method.  The BLL method called out to a method in the DAL that utilized the Enterprise Library to perform its data access.  No matter what, though, the "CreateDatabase()" method would return a Null Reference Exception when attempting to access the database.

In the end, I added a reference to the System.Configuration namespace to the Test Project and then voila - everything, all of a sudden, started to work.

This is strange behavior - but at least it works. 

Hope this helps someone else out there.

Published 18 June 07 08:08 by Greg

Comments

No Comments
Anonymous comments are disabled