Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mbunit and selenium

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

like image 238
ctb Avatar asked Feb 17 '26 05:02

ctb


1 Answers

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);
    }
}
like image 158
J.W. Avatar answered Feb 18 '26 19:02

J.W.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!