Re: Updates to NUnit 2.5
"Charlie Poole" <[email protected]> Thu, 3 Jul 2008 19:27:27 -0700
| Newsgroups | gmane.comp.windows.dotnet.nunit.devel |
|---|---|
| Message-ID | <000001c8dd7d$82424210$6401a8c0@ferrari> |
Hi All, Latest checkin finishes work on TestCaseFactories, which are methods, properties or fields that provide test cases to a parameterized test. There's one outstanding question I could use some ideas on - see the end of this note. TestCaseFactoryAttribute is an optional attribute that can be used to mark these factories. If used, it should specify the types of the arguments provided... e.g.: [TestCaseFactory(typeof(int), typeof(int), typeof(string))] FactoryAttribute is used on the parameterized test itself and has the following forms: [Factory] [Factory(Type factoryType)] [Factory(string factoryNames)] [Factory(Type factoryType, string factoryNames)] factoryType is the type of the object that holds the factory, defaulting to the same class as the test. factoryName is the name of the method, property or field that serves as a factory - or several names separated by commas. It defaults to "find all compatible test factories in the type". If you are looking for compatible test factories, that's when you need to mark them with the TestCaseFactoryAttribute. Compatible means that the types match the argumets of the test method. Here's the question: I'm still not happy with "Factory" to identify indicate that factories should be used, especially the form without any arguments. MbUnit uses "UsesFactories" for a similar situation, so that might work. Any ideas? Note that we will want to use the same attribute on individual arguments as well as on methods. Charlie ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08