rickgaribay.net

Space shuttles aren't built for rocket scientists, they're built for astronauts. The goal isn't the ship, its the moon.
posts - 303, comments - 180, trackbacks - 35

My Links

News

Where's Rick?


AgileAlliance deliver:Agile 2019- 4/29
Desert Code Camp, PHX - 10/11
VS Live Austin, TX - 6/3
VS Live SF - 6/17


About Me
Hands on leader, developer, architect specializing in the design and delivery of distributed systems in lean, agile environments with an emphasis in continuous improvement across people, process and technology. Speaker and published author with 18 years' experience leading the delivery of large and/or complex, high-impact distributed solutions in Retail, Intelligent Transportation, and Gaming & Hospitality.

I'm currently a Principal Engineer at Amazon, within the North America Consumer organization leading our global listings strategy that enable bulk and non-bulk listing experiences for our WW Selling Partners via apps, devices and APIs.

Full bio

Note: All postings on this site are my own and don’t necessarily represent the views of my employer.



Check out my publications on Amazon Kindle!





Archives

Post Categories

Published Works

Making Configuration Files Available to NUnit

NUnit can be run against any type of portable executable (PE), including DLLs and EXEs.

Often, you will need the test that is calling a component to behave as if it itself were the actual call site, meaning that any configuration settings that will be in effect at deployment time should take effect during testing as well. For EXE based assemblies, this is a trivial issue- simply add an app.config to the test project in Visual Studio and away you go.

When unit testing non-executable assemblies (DLLs), however, this isn't as straighforward because DLLs cannot execute without a host process. In this case, take the app.config you created and copy it into the bin directory in which the assembly you are testing is loaded. Rename the app.config to the full name of the assembly that NUnit will load.

For example, for an assembly called "Ess.ServiceGateways.Epm.Interop.dll", you would rename the app.config to "Ess.ServiceGateways.Epm.Interop.dll.config".

NUnit will probe for a configuration file with the same name of the assembly hosting the tests and load the configuration accordingly.

Print | posted on Wednesday, March 21, 2007 2:07 PM | Filed Under [ Misc. Visual Studio ]

Comments have been closed on this topic.

Powered by: