How to diagnose “TestFixtureSetUp Failed”

前端 未结 11 1121
感动是毒
感动是毒 2021-02-06 21:46

We use TeamCity as our CI server, and I\'ve just started seeing \"TestFixtureSetUp Failed\" in the test failure window.

Any idea how I go about debugging th

11条回答
  •  情话喂你
    2021-02-06 22:12

    I had this symptom caused by an error during field initialization. If your initialize your fields in the [SetUp] method, you should see a better error message.

    [TestFixture]
    internal class CommandParserTest
    {
        // obscure error message
        private CommandParser parser = new CommandParser(...);
        ...
    }
    
    [TestFixture]
    internal class CommandParserTest
    {
        private CommandParser parser;
    
        [SetUp]
        public void BeforeTest()
        {
            // better error message
            parser = new CommandParser(...);
        }
        ...
    }
    

提交回复
热议问题