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

前端 未结 9 1102
旧巷少年郎
旧巷少年郎 2021-01-30 15:59

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         


        
9条回答
  •  礼貌的吻别
    2021-01-30 16:33

    [TestFixtureSetUp] and [TestFixtureTearDown] are for whole test class. runs only once.

    [SetUp] and [TearDown] are for every test method(test). runs for every test.

提交回复
热议问题