.net - Trouble with NUnit when determining the assembly's directory -


i've started work nunit in order provide test coverage projects.

within main library.dll need load configuration data external file goes library, library.xml.

this works fine when i'm using library, because use following directory in config file:

string settingspath = path.getdirectoryname(system.reflection.assembly.getexecutingassembly().location); 

the problem i've noticed when i'm unit testing nunit, copies assemblies shadow copy, doesn't take of other files it, of course init fails due missing config files.

should doing different locate config files within library? (it's server app, , don't want use standard app settings, or user's local settings, etc)

when unit testing recommended avoid external dependencies such file system , databases, mocking/stubbing out routines call them - way tests more localised, less fragile , faster. see if can remove dependencies providing fake configuration information.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -