Re: Recent 2.5 Changes
"Charlie Poole" <[email protected]> Mon, 28 Jul 2008 15:20:06 -0700
| Newsgroups | gmane.comp.windows.dotnet.nunit.devel |
|---|---|
| Message-ID | <001101c8f100$174d1200$6401a8c0@ferrari> |
Hi Olof, > -----Original Message----- > From: Olof Bjarnason [mailto:[email protected]] > Sent: Monday, July 28, 2008 2:14 PM > To: Charlie Poole > Cc: [email protected] > Subject: Re: [nunit-developer] Recent 2.5 Changes > > >> > 2. DataSourceAttribute provides a way to point to data for > >> individual > >> > arguments just as FactoriesAttribute (I still don't like > that name) > >> > points to entire test cases. > >> > >> Could you provide a very brief syntax example of this? > >> > > > > [DataSource("MyData")] > > Could you elaborate a little bit? What is "MyData"? Is it the > name of a member variable, or maybe an IEnumerable field > attributed by a some kind of name-attribute with the string "MyData"? Sorry, I was assuming familiarity with FactoriesAttribute, which uses the same syntax... But try this... http://nunit.org/index.php?p=dataSource&r=2.5 Note that that page is not linked into the navigation, since the web site actually represents the Alpha-3 release. Charlie > > > > FWIW, I find inline data much more conducive to doing TDD. However, > > there can be a need to share data across multiple tests. > > > > Charlie > > > >> > > >> > 3. TestFixtures can now have parameters, which are used in > >> searching > >> > for a constructor. You repeat [TestFixture(...)] just as > you do for > >> > [TestCase(...)] and each individualized fixture is created > >> separately > >> > in the tree. > >> > >> Cool! So if I have several classes implementing an interface that > >> should adhere to specific rules specified by tests, I could > >> parameterize the fixture containing those tests with the specific > >> class implementations? Great! > >> > >> > > >> > 4. We already had generic fixtures and now they can have > parameters > >> > too. You can specify what types to use in creating a > specific class > >> > from the generic declaration in three ways... > >> > >> I have no clue what you are talking about, but I guess > it's great ;) > >> > >> > > >> > 1) By preceding the constructor args with a set of > >> > Types to be used. This won't work if the first > >> > constructor arg is a Type, of course. > >> > > >> > 2) By using the TypeArgs named property of TestFixtureAttribute > >> > > >> > 3) By using a constructor that makes use of all the > >> > Type parameters - in that case NUnit will figure > >> > it out. > >> > > >> > I'm aware that the last bit particuarly needs documentation. > >> > Consider the above as hints for the brave among you. > >> > > >> > Charlie > >> > > >> > > >> > > >> > > >> > > >> > > >> > --------------------------------------------------------------------- > >> - > >> > --- This SF.Net email is sponsored by the Moblin Your Move > >> Developer's > >> > challenge Build the coolest Linux based applications with > >> Moblin SDK & > >> > win great prizes Grand prize is a trip for two to an Open > >> Source event > >> > anywhere in the world > >> > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > >> > _______________________________________________ > >> > nunit-developer mailing list > >> > [email protected] > >> > https://lists.sourceforge.net/lists/listinfo/nunit-developer > >> > > >> > > > > > > > > > ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/