Enterprise library and Nunit Question

  • Thread starter Thread starter Gonza
  • Start date Start date
G

Gonza

Hi group, i'm trying to create tests for my solution, so i have a
project with nunit tests. I'm using the data application block as my
data access layer, and the problem i'm having is that when i try to run
a test that uses the block i get an exception because the block can't
read the configuration file (i supose it doesn't know where to look)
and therefore can create a connection to the database. Any ideas?

Thanks in advance
 
Gonza,
NUnit will pick up a "*.config" file that is the same name +".config" and is
in the same directory as the dll. In your property Build event you want to
copy an appropriate config file, perhaps your exe app.config file, to the dll
location. An example post build event would be:

copy /Y "..\..\..\CCUApp\app.config" "$(TargetDir)$(TargetFileName).config".

NUnit documenation does mention the config file being picked up.

- Marc
 
Back
Top