0

I'm using MbUnit + Gallio. I know that MbUnit has attributes which can be applied to methods which should run:

  1. [FixtureSetUp] - before each fixture
  2. [FixtureTearDown] - after each fixture
  3. [SetUp] - before each test
  4. [TearDown] - after each test

But, say, I run several fixtures at once. And I would like to run a piece of code after ALL fixtures have already been run.

Is it possible to do it?

trickbz
  • 945
  • 1
  • 9
  • 25

1 Answers1

0

Found the solution. It's very simple and elegant. You just have to create a separate class with [AssemblyFixture] attribute and define 2 methods with [FixtureSetUp] and [FixtureTearDown] attributes. They will be called before and after the whole fixture suite.

    [AssemblyFixture]
    public class FixtureAssemblyClass
    {
        [FixtureSetUp]
        public void BeforeRunAssembly()
        {

        }

        [FixtureTearDown]
        public void AfterRunAssembly()
        {

        }
    }
trickbz
  • 945
  • 1
  • 9
  • 25