|
From: Jim A. <jim...@ho...> - 2003-06-02 09:03:53
|
I generally extend Assertion too. On putting test methods inside the class under test - a nested class makes this slightly cleaner. Nested classes have full access to private members of the containing class, so you can have internal tests without bloating your public interface. In C# v2, Partial Types will be really useful for testing. You can have test methods in a separate file which only gets compiled-in for test builds. Jim >From: Jeremy Stell-Smith <ste...@ya...> >To: nmock <nmo...@li...> >Subject: Re: [Nmock-general] mocking members from base interfaces >Date: Sun, 1 Jun 2003 08:28:47 -0700 (PDT) > >Thanks, Joe, I'll try this out > >Yeah, I do this all the time. I was complaining to >Two about how there's no default TestCase that already >extends Assertion as there is in JUnit, and he pointed >out there's another pattern which is nice to use >sometimes. Which is the testcase extends the class >under test. So I'm happy extending assertion when >possible. > >Another idea that I'd be interested in hearing about >someone actually using is putting your test methods in >your production class. More and more I question >making everything separate. Plus it seems the >simplest thing that could possibly work. That said >I'm not doing it - yet. I think I still like to have >classes that are very small and elegant, test code >would obfuscate them a little (of course we could >always hide it in a test region :) hehe) > >Jeremy > >--- Joe Walnes <jo...@tr...> wrote: > > Thanks Jeremy - I'll look into this. > > > > I noticed that your testcase extends Assertion - I > > presume this is so > > it's easier to use use AssertBlah methods. Is this a > > pattern you use > > frequently? Does anyone else do this? > > > > -joe > > >__________________________________ >Do you Yahoo!? >The New Yahoo! Search - Faster. Easier. Bingo. >http://search.yahoo.com > > >------------------------------------------------------- >This SF.net email is sponsored by: eBay >Get office equipment for less on eBay! >http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 >_______________________________________________ >Nmock-general mailing list >Nmo...@li... >https://lists.sourceforge.net/lists/listinfo/nmock-general _________________________________________________________________ Use MSN Messenger to send music and pics to your friends http://www.msn.co.uk/messenger |