← Back to team overview

nunit-core team mailing list archive

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

 

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

-- 
You received this bug notification because you are a member of NUnit
Core Developers, which is the registrant for NUnit Framework.
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:
  Fix Committed

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