Enterprise library and Nunit Question

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top