Wednesday, April 11, 2007

MbUnit supports different flavors of parameterized unit tests: RowTest, CombinatorialTest, etc... If you are already using those features, it would be very easy for you to 'pexify' them:

namespace MyTest
{
     using MbUnit.Framework;
     using Microsoft.Pex.Framework;

     [TestFixture, PexClass]
     public partial class MyTestFixture
{
[RowTest]
[Row("a", "b")]
[PexTest]

public void Test(string a, string b)
{
...
}


}
}

Isn't this nice? :)

Some little notes:

  • 'partial' is helpfull to emit the generated unit test in the same class... but not the same file. Pex also support another mode where partial is not required.
  • the Pex attributes do not 'interfere' with the MbUnit ones. Your unit tests will still run exactly the same with MbUnit.
Sunday, April 15, 2007 4:50:05 PM UTC
Do you mean that after this a can run Unit Test inside VS( and PEX) using mbUnit attributes without using MbUnit GUI or another tool ?
Monday, April 16, 2007 12:41:25 AM UTC
Not exactly. We provide the tools to execute Pex parameterized unit tests. The end product are unit tests, tagged with the attributes for your unit tests (VSTS, NUnit or MbUnit).

Executing unit tests in the IDE is beyond our goal and is already supported by third-party tools (TD.NET, Resharper) or VSTS itself (Orcas release).
Comments are closed.