Look at TestFixtureSetup and TestFixtureTearDown which only run once per
fixture.

On Wed, Jun 24, 2009 at 3:54 PM, Rob Langley <[email protected]> wrote:

>
> Thanks for explain this.  I understand and can see why this is a good
> thing.
>
> I guess I was planning my test code incorrectly.  I was try to run
> [setup] and [tearDown] only once and re use certain tests for parts of
> other fuller tests.
>
> eg
>
> [setup]
> - [loginTest]
> - [createGroup] (needs to login first otherwise it will fail)
> [teardown]
>
> I do not want to keep repeating code so am trying to re use code where
> possible
>
> Thanks
>
> Rob
>
> On Jun 24, 12:58 pm, Tim Barcz <[email protected]> wrote:
> > I think this is a very very good thing.  Your tests should never rely on
> the
> > order in which they run.  In fact some frameworks will in fact jumble all
> of
> > the tests and randomize run order so that order will not matter (MbUnit
> may
> > be one of these...Jeff?) .
> >
> > It's not a C# thing at all but rather a "good unit test practice"
> >
> > Tim Barcz
> >
> >
> >
> >
> >
> > On Wed, Jun 24, 2009 at 2:05 AM, Rob Langley <[email protected]>
> wrote:
> >
> > > Hi
> >
> > > This is probably a basic question for someone who is more competent
> > > with c#.  I have written a number of tests grouped in different
> > > classes.  For instance:
> >
> > > BasicTests.cs
> > > [test1]
> >
> > > [test2]
> >
> > > AdvancedTests.cs
> > > [Test1]
> >
> > > Test2]
> >
> > > When I run them in either TeamCity or Gallio I can't seem to predict
> > > the order they will run?
> >
> > > Thanks in advance
> >
> > > Rob
> >
> > --
> > Tim Barcz
> > ASPInsiderhttp://timbarcz.devlicio.ushttp://www.twitter.com/timbarcz
> >
>


-- 
Tim Barcz
ASPInsider
http://timbarcz.devlicio.us
http://www.twitter.com/timbarcz

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MbUnit.User" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/MbUnitUser?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to