My suggestion would be to hold off until MbUnit v3 alpha 2 is released (in a
couple weeks we hope) and then to use the new data-driven testing features
like this:
[TestFixture]
public class MyFixture
{
[Column("1", "2", "3")]
// equivalent to: [Row("1"), Row("2"), Row("3")]
public string param;
[Test]
[Row("a", "z")]
[Row("b", "y")]
public void Test(string x, string y)
{
}
}
The Test method will be run 6 times with:
param="1", x="a", y="z"
param="1", x="b", y="y"
param="2", x="b", y="y"
param="2", x="b", y="y"
param="3", x="b", y="y"
param="3", x="b", y="y"
Jeff.
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Yanick Masse
Sent: Monday, December 17, 2007 9:55 AM
To: MbUnit.User
Subject: MbUnit Multi Setup Fixture
Hi,
I would like to develop a special fixture in which it would be a mix
of the RowTestAttribute and TestFixtureSetUpAttribute. Multiple
"MultiSetUp" attributes could be applied to a SetUp function. Tests
functions decorated with TestAttributes would be called once for each
occurence of the MultiSetUp function.
Here is a little example of this special fixture.
[MultiSetUpFixture]
public class TestMultiSetUpFixture
{
[MultiSetUp("1")]
[MultiSetUp("2")]
[MultiSetUp("3")]
public void MultiSetUp(string param1)
{
// Do some setup using param1...
}
[Test]
public void Test1()
{
}
[Test]
public void Test2()
{
}
[MultiSetUpTearDown]
public void MultiSetUpTearDown()
{
}
}
In this example, the methods would be invoked in the following order when
running the test:
MultiSetUp("1")
Test1()
Test2()
MultiSetUpTearDown()
MultiSetUp("2")
Test1()
Test2()
MultiSetUpTearDown()
MultiSetUp("3")
Test1()
Test2()
MultiSetUpTearDown()
Does someone have any hints to help me implement this special fixture or
another suggestions? My goal is to run my tests on multiple configuration
but I don't want my configuration to be applied for each test method.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---