The NUnit documentation doesn\'t tell me when to use a method with a TestFixtureSetup
and when to do the setup in the constructor.
public class MyTe
I think this has been one of the issues that hasn't been addressed by the nUnit team. However, there is the excellent xUnit project that saw this exact issue and decided that constructors were a good thing to use on test fixture initialization.
For nunit, my best practice in this case has been to use the TestFixtureSetUp
, TestFixtureTearDown
, SetUp
, and TearDown
methods as described in the documentation.
I think it also helps me when I don't think of an nUnit test fixture as a normal class, even though you are defining it with that construct. I think of them as fixtures, and that gets me over the mental hurdle and allows me to overlook this issue.