Problem with DataSource in 2.5 alpha 2

"Kelly Anderson" <[email protected]> Fri, 9 May 2008 11:08:58 -0600
Newsgroups gmane.comp.windows.dotnet.nunit.devel
Message-ID <[email protected]>
Charlie,

   Been VERY busy of late, but I have a little breather and I
installed the 2.5 beta 2. I'm now translating my own IterativeTests to
DataSource tests. There are a number of differences, which are fine.
Some of these differences are design decisions, and that's just a
matter of taste.

  One difference that I don't entirely understand is why my static
IEnumerable Property can't live in a base class like so:

class DataGenerators
{
  public static IEnumerable DivideCases
  {
    get
    {
      yield new object[] { 12, 3, 4 };
      yield new object[] { 12, 2, 6 };
      yield new object[] { 12, 4, 3 };
    }
  }
}

[TestFixture]
public class MyTests : DataGenerators
{
   [DataSource("DivideCases")]
  public void DivideTest(int n, int d, int q)
  {
    Assert.AreEqual( q, n / d );
  }
}

Was this an oversight, or a conscious design decision? If so, why?

-Kelly

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone