← Back to team overview

nunit-core team mailing list archive

[Bug 512730] Re: Throws ArgumentNullException when opening/running test assemblies containing testfixture with null parameters

 

** Changed in: nunitv2
       Status: Fix Committed => Fix Released

-- 
Throws ArgumentNullException when opening/running test assemblies containing testfixture with null parameters
https://bugs.launchpad.net/bugs/512730
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.

Status in NUnit V2 Test Framework: Fix Released

Bug description:
NUnit version: 2.5.3.9345
Description:
This exception is thrown when running test assemblies with following code.

    [TestFixture("A", null)]
    //[TestFixture(null, "A")]
    //[TestFixture(null, null)]
    public class TestClass
    {
        private string m_a;
        private string m_b;

        public TestClass(string a, string b)
        {
            m_a = a;
            m_b = b;
        }

        [Test]
        public void Test_AIsNotNull()
        {
            Assert.IsNotNullOrEmpty(m_a);
        }
    }

Exceptions Details:
TestCase 'T:TestLibrary.TestClass' failed: Value cannot be null.
	System.ArgumentNullException: Value cannot be null.
	at System.Type.GetTypeArray(Object[] args)
	at NUnit.Core.Builders.NUnitTestFixtureBuilder.CheckTestFixtureIsValid(TestFixture fixture)
	at NUnit.Core.Builders.NUnitTestFixtureBuilder.BuildSingleFixture(Type type, Attribute attr)
	at NUnit.Core.Builders.NUnitTestFixtureBuilder.BuildMultipleFixtures(Type type, Attribute[] attrs)
	at NUnit.Core.Builders.NUnitTestFixtureBuilder.BuildFrom(Type type)
	at NUnit.Core.Extensibility.SuiteBuilderCollection.BuildFrom(Type type)
	at NUnit.Core.TestFixtureBuilder.BuildFrom(Type type)
	at NUnit.Core.Builders.TestAssemblyBuilder.GetFixtures(Assembly assembly, String ns)
	at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites)
	at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites)
	at NUnit.Core.TestSuiteBuilder.BuildSingleAssembly(TestPackage package)
	at NUnit.Core.TestSuiteBuilder.Build(TestPackage package)
	at NUnit.AddInRunner.NUnitTestRunnerBase.run(ITestListener testListener, Assembly assembly, ITestFilter filter)
	at NUnit.AddInRunner.NUnitTestRunnerBase.runType(ITestListener testListener, Assembly assembly, Type type)
	at NUnit.AddInRunner.NUnitTestRunnerBase.MemberRun.Run(NUnitTestRunnerBase testRunner, ITestListener testListener, Assembly assembly)
	at NUnit.AddInRunner.NUnitTestRunnerBase.run(ITestListener testListener, Assembly assembly, IRun run)
	at NUnit.AddInRunner.NUnitTestRunnerBase.RunMember(ITestListener testListener, Assembly assembly, MemberInfo member)
	at TestDriven.TestRunner.AdaptorTestRunner.Run(ITestListener testListener, ITraceListener traceListener, String assemblyPath, String testPath)
	at TestDriven.TestRunner.ThreadTestRunner.Runner.Run()

0 passed, 1 failed, 0 skipped, took 0.80 seconds (NUnit 2.5).