'Description' parameter in both TestAttribute and TestCaseAttribute is not allowed

Bug #505899 reported by rnovoselov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NUnit Framework
Fix Released
Medium
Charlie Poole

Bug Description

To reproduce create a test method like this:

[Test(Description = "descr1"),
 TestCase("test", Description = "descr2")]
public void Test(string s)
{
}

In such a case loading the result test assembly into NUnit GUI causes the following exception:

--------

System.ArgumentException...

Server stack trace:
   at System.Collections.Specialized.ListDictionary.Add(Object key, Object value)
   at NUnit.Core.Builders.NUnitTestCaseBuilder.BuildSingleTestMethod(MethodInfo method, Test parentSuite, ParameterSet parms)
   at NUnit.Core.Builders.NUnitTestCaseBuilder.BuildParameterizedMethodSuite(MethodInfo method, Test parentSuite)
   at NUnit.Core.Builders.NUnitTestCaseBuilder.BuildFrom(MethodInfo method, Test parentSuite)
   at NUnit.Core.Extensibility.TestCaseBuilderCollection.BuildFrom(MethodInfo method, Test suite)
   at NUnit.Core.Builders.NUnitTestFixtureBuilder.AddTestCases(Type fixtureType)
   at NUnit.Core.Builders.NUnitTestFixtureBuilder.BuildSingleFixture(Type type, Attribute attr)
   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.Core.SimpleTestRunner.Load(TestPackage package)
   at NUnit.Core.ProxyTestRunner.Load(TestPackage package)
   at NUnit.Core.ProxyTestRunner.Load(TestPackage package)
   at NUnit.Core.RemoteTestRunner.Load(TestPackage package)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at NUnit.Core.TestRunner.Load(TestPackage package)
   at NUnit.Util.TestDomain.Load(TestPackage package)
   at NUnit.Util.TestLoader.ReloadTest(RuntimeFramework framework)

---------

As any of the 'Description = "..."' arguments is removed everything is OK again.

BR

Related branches

Revision history for this message
Charlie Poole (charlie.poole) wrote :

Is this in one of the releases or in the latest source?

Revision history for this message
rnovoselov (r-novoselov) wrote :

It's the version number 2.5.3.9345.

BR

Revision history for this message
Charlie Poole (charlie.poole) wrote :

This bug is actually the same as #490679 even though they refer to different attributes. Both of them are PropertyAttributes.

Changed in nunit-3.0:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 2.9.4
Changed in nunit-3.0:
assignee: nobody → Charlie Poole (charlie.poole)
status: Triaged → Fix Committed
Changed in nunit-3.0:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.