I can't quite figure out how to test my ws. It relies on a web.config
to load connection strings, output directores, etc, and I am trying to
test from within the project itself. NUnit GUI just loads the dll
(though I am using zanebug ATM.)
I currently do something like this :
[Test]
public function CrashMeBaby() {
FromUsComesKrashes fun = new FromUsComesKrashes ();
fun.DoIt(); //-- fireworks
}
It errors because it's not running inside a web process, and web.config
hasn't been loaded, and various properties are of course therefore
inaccessible?
What is the easiest way to get around this? I am looking at NUnitASP
right now, or possibly loading the required values directly from the
web.config using the wonderfully documented System.Configuration :)
Thanks for any help!
- Andrew
Manohar Kamath - 24 Aug 2005 04:15 GMT
If you download the latest NUnit (www.nunit.org), you can specify the
application configuration file for a given project. Specify web.config, and
you will be able to unit test your code. The only part you can't test easily
is anything that relies on an HTTP context.

Signature
Manohar Kamath
Editor, .netBooks
www.dotnetbooks.com
>I can't quite figure out how to test my ws. It relies on a web.config
> to load connection strings, output directores, etc, and I am trying to
[quoted text clipped - 19 lines]
>
> - Andrew
Andrew Backer - 28 Aug 2005 21:29 GMT
I didn't know you could do that! I am just loading the dll in the gui
and not actually making .nunit projects. I guess that'll have to
change. Thanks for pointing this out.
-Andrew