.config files with NUnit and TestDriven.Net
So how do you do it?
Get an assembly to read config when you're testing it with NUnit and TestDriven.net that is.
NUnit GUI has plenty GUI options up in the menus to select different configs. This is very nice.
Also in visual studio 2005 I noticed TestDriven.net copy app.config to where it was running its tests. But for the life of me I couldn't get it to do the same in 2003 /1.1 [.]
I doubt the problem is with the two frameworks. It's just me being rubbish. But here is how you get an assembly to read settings from a config file via TD.NET.
- Name the file the test assemblies name including the dll .config So
- TestAssembly.dll.config
- Copy it in the build directory bin / debug (or release maybe).
- Kablamo. It will read that one.
Note don't name it the name of the assembly under test. That's is if TestAssembly tests code in Assembly.dll don't call the file Assembly.dll.config.


0 Comments:
Post a Comment
<< Home