What's the difference between using the constructor in VS Testing framework vs. TestInitialize() attribute?

后端 未结 3 1784
庸人自扰
庸人自扰 2021-02-07 00:47

Quick question, I\'m using the Visual Studio\'s testing framework for unit testing. Just wondering what\'s the difference between using the constructor to do initialization work

3条回答
  •  无人共我
    2021-02-07 00:56

    The ctor is for initializing the object.

    TestInitialize is for initializing any objects or data needed to run the test.

提交回复
热议问题