Re: Blog: Four Ways to test Expected Exceptions
"David Jeske" <[email protected]> Sat, 2 Aug 2008 12:01:14 -0700
| Newsgroups | gmane.comp.windows.dotnet.nunit.user,gmane.comp.windows.dotnet.nunit.devel |
|---|---|
| Message-ID | <[email protected]> |
I find separating every single exception test into a different methods
inconvinent and unweildy, mostly because of the need to access local
variables. I usually use a codeblock like this sitting in a test function
with lots of other stuff. The block looks like this:
{
bool err = false;
try {
do_something();
} catch (MyException) {
err = true;
}
Assert.AreEqual(err,true, "Expected MyException");
}
I'd be happy for a more terse way to write this, but I don't see how to do
it while retaining the ability to access the test-function scope. Passing in
all the necessary arguments is just annoying.
On Fri, Aug 1, 2008 at 5:43 PM, Charlie Poole <[email protected]> wrote:
> Hi All,
>
> It's here: http://blogs.nunit.com
>
> Comments?
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nunit-users