0

I write this helloworld unit test and build it. It always have this build error: "The command://...../Nunit.ConsoleRunner3.6/nunit3-console.exe exited with code 1".I search all the stackoverflow but there is no a single thread about Nunit test exist code 1, do you know where can I find the information for this code?

using NUnit.Framework;

namespace SomeName
{
    [TestFixture]
    class IdentifierTest
    {
        [SetUp]
        public void SetUp()
        {

        }

        [TearDown]
        public void TearDown()
        {

        }

        [Test]
        public void DetectIDTest()
        {     
            Assert.AreEqual("hi","ho");
        }
    }
}
Tim He
  • 11
  • 3

1 Answers1

1

A positive exit code indicates the number of tests that has failed (in your case 1) as per this line in the NUnit console runner source code. Additional (negative) failure codes also have meaning per these six lines. This is substantiated by a discussion about exit codes here, I have attached the response as an image for easy reference enter image description here

DeadlyEmbrace
  • 450
  • 7
  • 9
  • I should have 10 failed test in the entire solution, why it only shows only the current working one failed test? @DeadlyEmbrace – Tim He Jul 17 '17 at 05:42
  • I think it shows only failures from the executed test set. So if you run all test in your solution it should return 10. Overall, I wouldn't worry too much about positive return code values, they simply indicate that one or more tests have failed. The negative codes are the real "problem children" – DeadlyEmbrace Jul 17 '17 at 05:51