When do I use the TestFixtureSetUp attribute instead of a default constructor?

Why would you need to use a constructor in your test classes?

I use [SetUp] and [TearDown] marked methods for code to be executed before and after each test, and similarly [TestFixtureSetUp] and [TestFixtureTearDown] marked methods for code to be executed only once before and after all test in the fixture have been run.

I guess you could probably substitute the [TestFixtureSetUp] for a constructor (although I haven’t tried), but this only seems to break from the clear convention that the marked methods provide.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)