views:

226

answers:

1

Hi,

Can anyone tell me how get mbunit to run more than one test at a time without it setting up and tearing down after every test?

Currently I'm using selenium for UI testing and need to run the tests consecutively do a login page.

Thanks in advance, cb

+1  A: 

Are you looking for FixtureSetUp/FixtureTearDown attribute [used to be called TestFixtureSetUp], which is called at class level, meaning, it will be set up once for all the tests in one test class.

Setup/TearDown attribute is called on Method level.

MbUnit also support test assembly setup and teardown. Here is a link for this.

[assembly: AssemblyCleanUp(typeof(AssemblyCleaner))]
...
public class AssemblyCleaner
{
    [SetUp]
    public static void SetUp()
    {
        Console.WriteLine("Setting up {0}", typeof(AssemblyCleanUp).Assembly.FullName);
    }
    [TearDown]
    public static void TearDown()
    {
        Console.WriteLine("Cleaning up {0}", typeof(AssemblyCleanUp).Assembly.FullName);
    }
}
J.W.
Thanks J.W, answered a few other questions I had as well :)
Calum Bett