Do you use TestInitialize or the test class constructor to prepare each test? and why?

后端 未结 10 670
梦毁少年i
梦毁少年i 2020-12-02 15:35

This question regards unit testing in Visual Studio using MSTest (this is important, because of MSTest\'s execution order). Both the method marked [TestInitialize] and the t

10条回答
  •  执笔经年
    2020-12-02 15:40

    This question is also asked (later) at What’s the difference between using the constructor in VS Testing framework vs. TestInitialize() attribute?

    FWIW I assume by "class constructor" you mean the instance constructor (not the static constructor).

    I believe the same question you are asking could equally be asked about the static constructor vs. ClassInitialize...

提交回复
热议问题