Why does TestInitialize get fired for every test in my Visual Studio unit tests?

后端 未结 4 1656
礼貌的吻别
礼貌的吻别 2020-12-02 06:50

I\'m using Visual Studio 2010 Beta 2. I\'ve got a single [TestClass], which has a [TestInitialize], [TestCleanup] and a few [Tes

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-02 07:12

    this is rather standard behaviour for test suites: setup and teardown before and after each test. The philosophy is that tests should not depend on each other. If you want another behaviour, you should probably use static objects that persist between each test.

提交回复
热议问题