Skip the SetUp method only for a particular test in NUnit?

后端 未结 6 1852
时光说笑
时光说笑 2021-01-01 19:47

I have a test where I do not need to run the SetUp method (attributed with [SetUp]) before running the test. I need the SetUp method t

6条回答
  •  一个人的身影
    2021-01-01 20:01

    You should create a new class for that test which has only the setup (or lack of setup) that it needs.

    Alternatively, you could unfactor the setup code into a method that all the other tests call, but I don't recommend this approach.

提交回复
热议问题