← Back to team overview

nunit-core team mailing list archive

[Bug 655674] Re: New Fixture Object Suite requires pre-constructed objects to have a no-arg constructor

 

** Branch linked: lp:nunitv2

-- 
New Fixture Object Suite requires pre-constructed objects to have a no-arg constructor
https://bugs.launchpad.net/bugs/655674
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 Committed

Bug description:
http://www.nunit.org/index.php?p=suite&r=2.4.8 cites that "Any other object is assumed to be a pre-created fixture object. This allows objects with parameterized constructors or settable properties to be used as fixtures."

However, the nunit-console (2.5.7.10213) complains that "No suitable constructor was found" when trying to run objects which were passed in to the suite.

Presumably there's a check for a no-arg constructor hanging around from the old style SuiteAttribute type which is failing, despite the object being pre-constructed.

The attached patch shows an example of this failure, and here's an example trace:


>nunit-console.exe NUnitSuiteBug.dll /fixture:NUnitSuiteBug.TestSuite
NUnit version 2.5.7.10213
Copyright (C) 2002-2009 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.

Runtime Environment -
   OS Version: Microsoft Windows NT 6.1.7600.0
  CLR Version: 2.0.50727.4952 ( Net 2.0 )

ProcessModel: Default    DomainUsage: Single
Execution Runtime: Default
.N
Tests run: 0, Errors: 0, Failures: 0, Inconclusive: 0, Time: 0.0290029 seconds
  Not run: 1, Invalid: 1, Ignored: 0, Skipped: 0

Tests Not Run:
1) NotRunnable : NUnitSuiteBug.TestClass.ValueShouldEqual123
   No suitable constructor was found





References