Is it bad form to count on the order of your NUnit unit tests

后端 未结 8 1768
别跟我提以往
别跟我提以往 2021-02-13 06:16

I have been creating Unit tests like crazy and find that I\'m often having to set up something in one test that I just tore down in a previous test. Is it ever reasonable to cr

8条回答
  •  悲哀的现实
    2021-02-13 06:55

    I would view each test as completely independent from any other test. Even if you could mandate the order of the tests, it would be a maintenance nightmare when the tests must change.

提交回复
热议问题