Last post Feb 25, 2007 06:27 PM by headdeball
Feb 22, 2007 09:28 PM|headdeball|LINK
I have installed the WSF (Web Service Software Factory) and am using it for my development. I know want to test my business layer that calls to my data layer using NUnit. I have a problem though.
When I run my project in development mode everything is fine - the database connection is picked up in from the web.config of my Host project. However when I try to run my test library (which is just a class library with the NUnit GUI setup to launch on
starting up the class library), I have problem in that there is nowhere to define my database connection in a app.config or web.config file. I added an app.config file to my test library - this seemed to work yesterday. However, today it doesn't work and I'm
getting an error from the database factory creating the database that the database "MyDatabase" is not defined in the configuration :-( Any ideas?
Feb 25, 2007 06:27 PM|headdeball|LINK
Aha! I have figured it out. When I set up NUnit I was following a guide which never mentioned to set command line parameters. To get around my problem I changed the project properties for my test C# library to
Start external program: path\to\NUnit\ni\nunit-gui.exe
Command line arguments: TestLibrary.dll
Working directory: path\to\TestLibrary\bin\Debug\
If you don't do this then I think nunit will work off the C# project file or the nunit project (I'm not sure which) that you have defined - as opposed to the DLL - which nunit won't pick up your app.config.