← Back to team overview

nunit-core team mailing list archive

[Bug 556971] Re: Datapoint(s)Attribute should work on IEnumerable<T> as well as on Arrays

 

** Changed in: nunit-3.0
       Status: Fix Committed => Fix Released

-- 
Datapoint(s)Attribute should work on IEnumerable<T> as well as on Arrays
https://bugs.launchpad.net/bugs/556971
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.

Status in NUnit Test Framework: Fix Released
Status in NUnit V2 Test Framework: Fix Released

Bug description:
[Copied from a thread on the nunit-discuss list]

I am currently playing around with NUnit's concept of theories /
datapoints.
I want to use lists as parameter for a certain Theory(test).

My code is structured like this:

//Preparation of data

 public static List<MySpecialEnum> PrepareList()
 {
           List<MySpecialEnum> settings = new List<MySpecialEnum>();
           foreach (MySpecialEnum setting in
Enum.GetValues(typeof(MySpecialEnum)))
           {
                   settings.Add(setting);
           }
           return settings;
 }

//prepare datapoints
[Datapoints]
 public static List<MySpecialEnum> settingValues = PrepareList();

//create theory
[Theory]
public void CTATheorySample(MySpecialEnum settingVal)
{
 Assume.That(/*everything is okay with settingVal */);
}

When I try to execute the tests, no parameter is visualised in the
NUnit UI and the error "no arguments were provided" is shown in the
NUnit "errors and failures" window!
Do you have any hints or workarounds for me ??
By the way I am using NUnit 2.5.3

Best regards and thanks for any hints,

Bernie





References