When you are testing a class library, that depends on the executable's config file, you can find yourself in bit of a fix. NUnit does allow you to use a config file, but it needs to be in the same directory as the build of the test project (which is also a DLL) and named <test_lib_name>.dll.config.
This is the easy way to get yourself setup to test against a DLL - you go into the project properties, and you put the following command into the "Pre-Build Event Command Line" box:
copy /Y "$(ProjectDir)App.config" "$(TargetDir)$(TargetFileName).config"
You then copy your App.Config file from your EXE project and away you go - the command provided (above) takes care of naming the config file and copying it to the right directory evey time you build the project!
Subscribe to:
Post Comments (Atom)
Migrating (and Open-Sourcing) an Historical Codebase: SVN-to-Git
I have a SVN repo on my local machine that I have been shoving stuff into since before I knew how to use revision control systems properly (...


-
As time goes on, the world is becoming more-and-more automated by software. This essentially also means that there is an exponentially growi...
-
It's been a while since I made a purely technical post... So, today I wanted to make a change to a Microsoft Team Foundation Server 20...
-
Wow, I am really going nuts blogging this-evening - 2nd post in less than an hour. Anyway this is a particularly nasty error that I keep...

No comments:
Post a Comment