Re: Detecting test method name during TestFixtureSetup

"Eric Mangold" <[email protected]> Tue, 26 Aug 2008 14:36:49 -0500
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <[email protected]>
Yes, indeed. I've implemented a simple addin using EventListener, and
it's working quite well. I only wanted to show start/end messages for
certain tests-not all of them-so that's why I needed something custom.

-Eric

On Tue, Aug 26, 2008 at 2:20 PM, Charlie Poole
<[email protected]> wrote:
> The event listener interface will do what you want. However, the function
> of marking the start (not the end) of each test is already provided by
> NUnit, so you may want to look at that first.
>
> In the gui, you should look at output options to set this up. In the
> console, use the /labels option on the commad line.
>
> Charlie
>
> ________________________________
> From: [email protected]
> [mailto:[email protected]] On Behalf Of
> [email protected]
> Sent: Tuesday, August 26, 2008 1:16 AM
> To: Eric Mangold; [email protected]
> Subject: Re: [Nunit-users] Detecting test method name during
> TestFixtureSetup
>
>
> Eric,
>
> I think this article will help.
>
> http://www.simple-talk.com/dotnet/.net-tools/testing-times-ahead-extending-nunit/
>
> The last topic "Event Listeners" might be what you looking for. This might
> be the easy method.
>
> The hard way can be by implementing an attribute as described in the article
> and Fig 17 will show you the exact code. I tried this method. It worked for
> me.
>
> Regards,
> Grishma Khandwalla
>
>
>
>
> "Eric Mangold" <[email protected]>
> Sent by: [email protected]
>
> 08/26/2008 12:03 PM
>
> To
> nunit-users <[email protected]>
> cc
> Subject
> [Nunit-users] Detecting test method name during TestFixture Setup
>
>
>
>
> Is there any way to detect the name of the test method, or get access
> to it via reflection, from withing the [Setup] method? If there is, I
> assume the same technique applies equally well to [Teardown]?
>
> I have the need to print log messages to standard output showing the
> start and end of each test.
>
> Regards,
> Eric Mangold
>
> -------------------------------------------------------------------------
> 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
>
>

-------------------------------------------------------------------------
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=/