How to run NUnit test fixtures serially?

前端 未结 4 1450
暗喜
暗喜 2020-12-29 05:04

I have several suites of integration tests implemented in C#/NUNit. Each test suite is a separate class, each fixture setup creates and populates a SQL Server database from

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-29 05:16

    I don't know whether it is possible to prevent ReSharper from running tests in parallel; if not, the following hack might work: Create a static class with a static readonly Monitor member. Then, in [TestFixtureSetUp], call Enter() on the monitor, and call Exit() on the monitor in [TestFixtureTearDown]. That way, only one test fixture will be allowed to run at a time. Not pretty, though...

提交回复
热议问题