NUnit SetUpFixture attribute equivalent in xUnit?
问题 In nUnit, SetUpFixture allowed me to run some code before any tests. Is there anything like that when using xUnit? From nUnit documentation: This is the attribute that marks a class that contains the one-time setup or teardown methods for all the test fixtures under a given namespace. 回答1: xUnit's comparison table shows that where you would use [TestFixtureSetUp] in NUnit, you make your test fixture class implement IUseFixture<T> . If [TestFixtureSetUp] isn't the attribute you're looking for,