← Back to team overview

nunit-core team mailing list archive

[Bug 898256] Re: IEnumerable<T> for Datapoints doesn't work

 

** Changed in: nunitv2
       Status: New => Triaged

** Changed in: nunitv2
   Importance: Undecided => High

** Changed in: nunitv2
     Assignee: (unassigned) => Charlie Poole (charlie.poole)

** Also affects: nunit-3.0
   Importance: Undecided
       Status: New

** Changed in: nunit-3.0
       Status: New => Triaged

** Changed in: nunit-3.0
   Importance: Undecided => High

** Changed in: nunit-3.0
     Assignee: (unassigned) => Charlie Poole (charlie.poole)

** Changed in: nunit-3.0
    Milestone: None => 2.9.6

-- 
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
https://bugs.launchpad.net/bugs/898256

Title:
  IEnumerable<T> for Datapoints doesn't work

Status in NUnit Test Framework:
  Triaged
Status in NUnit V2 Test Framework:
  Triaged

Bug description:
  When I try to return an IEnumerable<T> for the Datapoints attribute in
  2.5.10, I get:

  NUnitTheoryTest.SqrtTests.SquareRootDefinition: 
  System.InvalidCastException : Unable to cast object of type 
  '<Values>d__0' to type 'System.Collections.ICollection'. 

  
  The following code should work:

  
  [Datapoints]
   public IEnumerable<double> Values()
   {
       for (int i = 0; i < 10; i++)
                  yield return 0.25*i;

        yield break;
   }

To manage notifications about this bug go to:
https://bugs.launchpad.net/nunit-3.0/+bug/898256/+subscriptions


References