Discussion:
Updates to NUnit 2.5
Charlie Poole
2008-06-16 19:14:21 UTC
Permalink
Hi All,

Now that I'm back home, I can properly upload a number of changes
I made on my laptop while travelling.

So far, I have made the following changes:

1. The release is now 2.5 Alpha 3.

2. I have changed DataSourceAttribute to FactoryAttribute and it
may now appear on a property, field or method. Any of these may
be either static or instance members.

3. IParameterProvider.GetParametersFor(MethodInfo method) now
returns IEnumerable rather than IList.

4. The Test abstract class now has default implementations for
several properties that were previously abstract. One of the
Run() overloads has been removed.

I'll post further as more changes are made.

Charlie




-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Charlie Poole
2008-06-22 16:28:59 UTC
Permalink
More updates checked into CVS. All of this will be documented
for the release, but some of you may want an early heads-up,
especially if you are working on addins.

EXTENSIBILITY

The ParameterProviders extension point has been renamed
to TestCaseProviders. The interface that extensions must
implement is now ITestCaseProvider. Here's the definition:

public interface ITestCaseProvider
{
bool HasTestCasesFor(MethodInfo method);
IEnumerable GetTestCasesFor(MethodInfo method);
}

This is essentially the same as the IParameterProvider
interface in the first two alphas.

BUILT-IN PARAMETERIZED TESTS

NUnit currently has two built-in providers:
TestCaseParameterProvider for TestCaseAttribute and
TestCaseFactoryProvider for FactoryAttribute.

TestCaseParameterProvider will perform a number of
conversions in order to make the provided argument
compatible with method call.

TestCaseFactoryProvider can work with properties,
methods and fields that implement IEnumerable. For
static cases, use of an array is the simplest
approach. Either static or instance members may be
used. For methods takin a single ValueType argument,
the enumerator may return the bare argument rather
than an array with one member.

All of the above work at load time. For dynamic
test cases, provided at the instance of executin
the test and possibly varying from run to run, I
plan to add DynamicTest and DynamicTestCaseProvider.

OTHER STUFF

The RequiredAddinAttribute may be placed on the assembly,
on a class or on a method. If the named addin is not
loaded, the test or suite is NotRunnable and shows up
as red in the Gui.

Charlie
-----Original Message-----
Behalf Of Charlie Poole
Sent: Monday, June 16, 2008 12:14 PM
Subject: [nunit-developer] Updates to NUnit 2.5
Hi All,
Now that I'm back home, I can properly upload a number of
changes I made on my laptop while travelling.
1. The release is now 2.5 Alpha 3.
2. I have changed DataSourceAttribute to FactoryAttribute and
it may now appear on a property, field or method. Any of
these may be either static or instance members.
3. IParameterProvider.GetParametersFor(MethodInfo method) now
returns IEnumerable rather than IList.
4. The Test abstract class now has default implementations
for several properties that were previously abstract. One of the
Run() overloads has been removed.
I'll post further as more changes are made.
Charlie
--------------------------------------------------------------
-----------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just about
anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Charlie Poole
2008-06-24 21:59:48 UTC
Permalink
More updates for those following CVS - note that the attached
emails cover all the important changes since the Alpha 2 release,
and will be reflected in the next Alpha in a few weeks.

There is a major change to the Test hierarchy: TestCase doesn't
exist any longer. TestMethod inherits directly from Test now
and represents a Test implemented by a method. There could be
some further changes in this branch as well as for TestSuite,
TestFixture, etc.

All this is part of the move to parameterized tests, which
blurs the distinction between a suite and a case. I'm currently
using "test case" to refer to a single execution of a test with
one set of parameters, producing one result and the class names
will begin to reflect that.

NUnitTestCaseBuilder is now split in two, with the original
builder handling "regular" tests and ParameterizedTestCaseBuilder
handling parameterized tests. A new DynamicTestBuilder, which
recognizes DynamicTestAttribute and creates DynamicTests is

Charlie
-----Original Message-----
Behalf Of Charlie Poole
Sent: Sunday, June 22, 2008 9:29 AM
Subject: Re: [nunit-developer] Updates to NUnit 2.5
More updates checked into CVS. All of this will be documented
for the release, but some of you may want an early heads-up,
especially if you are working on addins.
EXTENSIBILITY
The ParameterProviders extension point has been renamed to
TestCaseProviders. The interface that extensions must
public interface ITestCaseProvider
{
bool HasTestCasesFor(MethodInfo method);
IEnumerable GetTestCasesFor(MethodInfo method);
}
This is essentially the same as the IParameterProvider
interface in the first two alphas.
BUILT-IN PARAMETERIZED TESTS
TestCaseParameterProvider for TestCaseAttribute and
TestCaseFactoryProvider for FactoryAttribute.
TestCaseParameterProvider will perform a number of
conversions in order to make the provided argument compatible
with method call.
TestCaseFactoryProvider can work with properties, methods and
fields that implement IEnumerable. For static cases, use of
an array is the simplest approach. Either static or instance
members may be used. For methods takin a single ValueType
argument, the enumerator may return the bare argument rather
than an array with one member.
All of the above work at load time. For dynamic test cases,
provided at the instance of executin the test and possibly
varying from run to run, I plan to add DynamicTest and
DynamicTestCaseProvider.
OTHER STUFF
The RequiredAddinAttribute may be placed on the assembly, on
a class or on a method. If the named addin is not loaded, the
test or suite is NotRunnable and shows up as red in the Gui.
Charlie
-----Original Message-----
Charlie Poole
Sent: Monday, June 16, 2008 12:14 PM
Subject: [nunit-developer] Updates to NUnit 2.5
Hi All,
Now that I'm back home, I can properly upload a number of changes I
made on my laptop while travelling.
1. The release is now 2.5 Alpha 3.
2. I have changed DataSourceAttribute to FactoryAttribute
and it may
now appear on a property, field or method. Any of these may
be either
static or instance members.
3. IParameterProvider.GetParametersFor(MethodInfo method)
now returns
IEnumerable rather than IList.
4. The Test abstract class now has default implementations
for several
properties that were previously abstract. One of the
Run() overloads has been removed.
I'll post further as more changes are made.
Charlie
--------------------------------------------------------------
-----------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just about anything
Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
--------------------------------------------------------------
-----------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just about
anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Charlie Poole
2008-06-27 17:42:04 UTC
Permalink
Checked in a VS2008 build and blogged about it here:
http://nunit.org/blogs/?p=61

Charlie
-----Original Message-----
Behalf Of Charlie Poole
Sent: Sunday, June 22, 2008 9:29 AM
Subject: Re: [nunit-developer] Updates to NUnit 2.5
More updates checked into CVS. All of this will be documented
for the release, but some of you may want an early heads-up,
especially if you are working on addins.
EXTENSIBILITY
The ParameterProviders extension point has been renamed to
TestCaseProviders. The interface that extensions must
public interface ITestCaseProvider
{
bool HasTestCasesFor(MethodInfo method);
IEnumerable GetTestCasesFor(MethodInfo method);
}
This is essentially the same as the IParameterProvider
interface in the first two alphas.
BUILT-IN PARAMETERIZED TESTS
TestCaseParameterProvider for TestCaseAttribute and
TestCaseFactoryProvider for FactoryAttribute.
TestCaseParameterProvider will perform a number of
conversions in order to make the provided argument compatible
with method call.
TestCaseFactoryProvider can work with properties, methods and
fields that implement IEnumerable. For static cases, use of
an array is the simplest approach. Either static or instance
members may be used. For methods takin a single ValueType
argument, the enumerator may return the bare argument rather
than an array with one member.
All of the above work at load time. For dynamic test cases,
provided at the instance of executin the test and possibly
varying from run to run, I plan to add DynamicTest and
DynamicTestCaseProvider.
OTHER STUFF
The RequiredAddinAttribute may be placed on the assembly, on
a class or on a method. If the named addin is not loaded, the
test or suite is NotRunnable and shows up as red in the Gui.
Charlie
-----Original Message-----
Charlie Poole
Sent: Monday, June 16, 2008 12:14 PM
Subject: [nunit-developer] Updates to NUnit 2.5
Hi All,
Now that I'm back home, I can properly upload a number of changes I
made on my laptop while travelling.
1. The release is now 2.5 Alpha 3.
2. I have changed DataSourceAttribute to FactoryAttribute
and it may
now appear on a property, field or method. Any of these may
be either
static or instance members.
3. IParameterProvider.GetParametersFor(MethodInfo method)
now returns
IEnumerable rather than IList.
4. The Test abstract class now has default implementations
for several
properties that were previously abstract. One of the
Run() overloads has been removed.
I'll post further as more changes are made.
Charlie
--------------------------------------------------------------
-----------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just about anything
Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
--------------------------------------------------------------
-----------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just about
anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Charlie Poole
2008-07-01 02:11:42 UTC
Permalink
Hi All,

Latest checkins include new version numbering scheme for
NUnit and generic parameterized test methods.

The NUnit 2.5 Alphas were both numbered 2.5.0.0, which could
be confusing. From now the release builds will carry a build
number in the fourth position, of the form yddd, where y is
the last digit of the year and ddd is the day number within
the year. So, if 2.5 were released today, it would be
2.5.0.8182.

Parameterized test methods can now be generic and NUnit will
provide an appropriate specialization of the method for each
set of parameters provided. This is actually of limited
utility by itself, but will be more useful in combination with
the support for generic fixtures I'm currently working on.

Charlie
-----Original Message-----
Behalf Of Charlie Poole
Sent: Friday, June 27, 2008 10:42 AM
Subject: Re: [nunit-developer] Updates to NUnit 2.5
http://nunit.org/blogs/?p=61
Charlie
-----Original Message-----
Charlie Poole
Sent: Sunday, June 22, 2008 9:29 AM
Subject: Re: [nunit-developer] Updates to NUnit 2.5
More updates checked into CVS. All of this will be
documented for the
release, but some of you may want an early heads-up,
especially if you
are working on addins.
EXTENSIBILITY
The ParameterProviders extension point has been renamed to
TestCaseProviders. The interface that extensions must
implement is now
public interface ITestCaseProvider
{
bool HasTestCasesFor(MethodInfo method);
IEnumerable GetTestCasesFor(MethodInfo method);
}
This is essentially the same as the IParameterProvider interface in
the first two alphas.
BUILT-IN PARAMETERIZED TESTS
TestCaseParameterProvider for TestCaseAttribute and
TestCaseFactoryProvider for FactoryAttribute.
TestCaseParameterProvider will perform a number of conversions in
order to make the provided argument compatible with method call.
TestCaseFactoryProvider can work with properties, methods
and fields
that implement IEnumerable. For static cases, use of an
array is the
simplest approach. Either static or instance members may be
used. For
methods takin a single ValueType argument, the enumerator
may return
the bare argument rather than an array with one member.
All of the above work at load time. For dynamic test cases,
provided
at the instance of executin the test and possibly varying
from run to
run, I plan to add DynamicTest and DynamicTestCaseProvider.
OTHER STUFF
The RequiredAddinAttribute may be placed on the assembly,
on a class
or on a method. If the named addin is not loaded, the test
or suite is
NotRunnable and shows up as red in the Gui.
Charlie
-----Original Message-----
Behalf Of
Charlie Poole
Sent: Monday, June 16, 2008 12:14 PM
Subject: [nunit-developer] Updates to NUnit 2.5
Hi All,
Now that I'm back home, I can properly upload a number of
changes I
made on my laptop while travelling.
1. The release is now 2.5 Alpha 3.
2. I have changed DataSourceAttribute to FactoryAttribute
and it may
now appear on a property, field or method. Any of these may
be either
static or instance members.
3. IParameterProvider.GetParametersFor(MethodInfo method)
now returns
IEnumerable rather than IList.
4. The Test abstract class now has default implementations
for several
properties that were previously abstract. One of the
Run() overloads has been removed.
I'll post further as more changes are made.
Charlie
--------------------------------------------------------------
-----------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just
about anything
Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
--------------------------------------------------------------
-----------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just about anything
Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
--------------------------------------------------------------
-----------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just about
anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Charlie Poole
2008-07-03 01:17:19 UTC
Permalink
[NOTE: I'm now updating the release notes for the 2.5
release when I make these posts, so they no longer need
to be cumulative. See http://nunit.org/?p=releaseNotes&r=2.5]

Latest CVS updates:

Simone Busoli contributed an IsOrdered constraint and
assertion for use on collections.

TestFixtures may now be generic and have the specific
types to use as type arguments provided on the TestFixture
attribute. You can have multiple TestFixture attributes
on one class. See my blog for an example: http://nunit.org/blogs.

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
Kelly Anderson
2008-07-03 16:25:26 UTC
Permalink
Things have been crazy busy lately, but I'm still very interested in
2.5 and 3.0!

When do you anticipate having a third alpha of 2.5 for download rather
than the CVS?

-Kelly

On Wed, Jul 2, 2008 at 7:17 PM, Charlie Poole
Post by Charlie Poole
[NOTE: I'm now updating the release notes for the 2.5
release when I make these posts, so they no longer need
to be cumulative. See http://nunit.org/?p=releaseNotes&r=2.5]
Simone Busoli contributed an IsOrdered constraint and
assertion for use on collections.
TestFixtures may now be generic and have the specific
types to use as type arguments provided on the TestFixture
attribute. You can have multiple TestFixture attributes
on one class. See my blog for an example: http://nunit.org/blogs.
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
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
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
Charlie Poole
2008-07-03 16:35:56 UTC
Permalink
"Soon" :-)

Seriously, I'll evaluate today or tomorrow whether to release with
what I have or to go into next week. As it looks now, the difference
will probably be whether parameterized fixtures make it into the
release.

Charlie
-----Original Message-----
Behalf Of Kelly Anderson
Sent: Thursday, July 03, 2008 9:25 AM
Subject: Re: [nunit-developer] Updates to NUnit 2.5
Things have been crazy busy lately, but I'm still very interested in
2.5 and 3.0!
When do you anticipate having a third alpha of 2.5 for
download rather than the CVS?
-Kelly
On Wed, Jul 2, 2008 at 7:17 PM, Charlie Poole
Post by Charlie Poole
[NOTE: I'm now updating the release notes for the 2.5
release when I
Post by Charlie Poole
make these posts, so they no longer need to be cumulative. See
http://nunit.org/?p=releaseNotes&r=2.5]
Simone Busoli contributed an IsOrdered constraint and assertion for
use on collections.
TestFixtures may now be generic and have the specific types
to use as
Post by Charlie Poole
type arguments provided on the TestFixture attribute. You can have
multiple TestFixture attributes on one class. See my blog for an
example: http://nunit.org/blogs.
Charlie
----------------------------------------------------------------------
Post by Charlie Poole
--- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open
source project,
Post by Charlie Poole
along with a healthy diet, reduces your potential for
chronic lameness
Post by Charlie Poole
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
--------------------------------------------------------------
-----------
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
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
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
Charlie Poole
2008-07-04 02:27:27 UTC
Permalink
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
Charlie Poole
2008-07-04 19:42:08 UTC
Permalink
I just updated the online documentation to match what's in CVS.
See for example:
http://nunit.org/?p=testCase&r=2.5
http://nunit.org/?p=factory&r=2.5
http://nunit.org/?p=testCaseFactory&r=2.5

I'm still looking for suggestions regarding renaming FactoryAttribute.

Charlie
-----Original Message-----
Behalf Of Charlie Poole
Sent: Thursday, July 03, 2008 7:27 PM
Subject: Re: [nunit-developer] Updates to NUnit 2.5
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
[TestCaseFactory(typeof(int), typeof(int), typeof(string))]
FactoryAttribute is used on the parameterized test itself and
[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
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
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
Olof Bjarnason
2008-07-04 20:26:46 UTC
Permalink
What about "Source"? Or maybe that's already taken?
Post by Charlie Poole
I just updated the online documentation to match what's in CVS.
http://nunit.org/?p=testCase&r=2.5
http://nunit.org/?p=factory&r=2.5
http://nunit.org/?p=testCaseFactory&r=2.5
I'm still looking for suggestions regarding renaming FactoryAttribute.
Charlie
-----Original Message-----
Behalf Of Charlie Poole
Sent: Thursday, July 03, 2008 7:27 PM
Subject: Re: [nunit-developer] Updates to NUnit 2.5
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
[TestCaseFactory(typeof(int), typeof(int), typeof(string))]
FactoryAttribute is used on the parameterized test itself and
[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
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
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
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
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
Charlie Poole
2008-07-04 20:47:02 UTC
Permalink
Sounds like a good possibility, although it seems to share
with "Factory" the deficiency of not making much sense when
used without arguments.

Maybe I should leave the attribute off in that case...

What if
[Test]
public void Method(int x, int y) { ... }
automatically searched for a factory within the class?

Would that lead to confusion?

Charlie
-----Original Message-----
Behalf Of Olof Bjarnason
Sent: Friday, July 04, 2008 1:27 PM
To: Charlie Poole
Subject: Re: [nunit-developer] Updates to NUnit 2.5
What about "Source"? Or maybe that's already taken?
Post by Charlie Poole
I just updated the online documentation to match what's in CVS.
http://nunit.org/?p=testCase&r=2.5
http://nunit.org/?p=factory&r=2.5
http://nunit.org/?p=testCaseFactory&r=2.5
I'm still looking for suggestions regarding renaming
FactoryAttribute.
Post by Charlie Poole
Charlie
-----Original Message-----
Behalf Of
Post by Charlie Poole
Charlie Poole
Sent: Thursday, July 03, 2008 7:27 PM
Subject: Re: [nunit-developer] Updates to NUnit 2.5
Hi All,
Latest checkin finishes work on TestCaseFactories, which
are methods,
Post by Charlie Poole
properties or fields that provide test cases to a
parameterized test.
Post by Charlie Poole
There's one outstanding question I could use some ideas on
- see the
Post by Charlie Poole
end of this note.
TestCaseFactoryAttribute is an optional attribute that can
be used to
Post by Charlie Poole
mark these factories. If used, it should specify the types of the
[TestCaseFactory(typeof(int), typeof(int), typeof(string))]
FactoryAttribute is used on the parameterized test itself
and has the
Post by Charlie Poole
[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
Post by Charlie Poole
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.
Post by Charlie Poole
Here's the question: I'm still not happy with "Factory" to
identify
Post by Charlie Poole
indicate that factories should be used, especially the
form without
Post by Charlie Poole
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,
Post by Charlie Poole
along with a healthy diet, reduces your potential for chronic
lameness and boredom. Vote Now at
http://www.sourceforge.net/community/cca08
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
----------------------------------------------------------------------
Post by Charlie Poole
--- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open
source project,
Post by Charlie Poole
along with a healthy diet, reduces your potential for
chronic lameness
Post by Charlie Poole
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
--------------------------------------------------------------
-----------
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
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
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
Olof Bjarnason
2008-07-04 21:04:56 UTC
Permalink
Is "Factory without arguments" a ubique use case or an esoteric one? I
for one would like to clearly state were my Test Case data came from
(the Source)

I always think twice before making things "automagical" ...
Post by Charlie Poole
Sounds like a good possibility, although it seems to share
with "Factory" the deficiency of not making much sense when
used without arguments.
Maybe I should leave the attribute off in that case...
What if
[Test]
public void Method(int x, int y) { ... }
automatically searched for a factory within the class?
Would that lead to confusion?
Charlie
-----Original Message-----
Behalf Of Olof Bjarnason
Sent: Friday, July 04, 2008 1:27 PM
To: Charlie Poole
Subject: Re: [nunit-developer] Updates to NUnit 2.5
What about "Source"? Or maybe that's already taken?
Post by Charlie Poole
I just updated the online documentation to match what's in CVS.
http://nunit.org/?p=testCase&r=2.5
http://nunit.org/?p=factory&r=2.5
http://nunit.org/?p=testCaseFactory&r=2.5
I'm still looking for suggestions regarding renaming
FactoryAttribute.
Post by Charlie Poole
Charlie
-----Original Message-----
Behalf Of
Post by Charlie Poole
Charlie Poole
Sent: Thursday, July 03, 2008 7:27 PM
Subject: Re: [nunit-developer] Updates to NUnit 2.5
Hi All,
Latest checkin finishes work on TestCaseFactories, which
are methods,
Post by Charlie Poole
properties or fields that provide test cases to a
parameterized test.
Post by Charlie Poole
There's one outstanding question I could use some ideas on
- see the
Post by Charlie Poole
end of this note.
TestCaseFactoryAttribute is an optional attribute that can
be used to
Post by Charlie Poole
mark these factories. If used, it should specify the types of the
[TestCaseFactory(typeof(int), typeof(int), typeof(string))]
FactoryAttribute is used on the parameterized test itself
and has the
Post by Charlie Poole
[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
Post by Charlie Poole
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.
Post by Charlie Poole
Here's the question: I'm still not happy with "Factory" to
identify
Post by Charlie Poole
indicate that factories should be used, especially the
form without
Post by Charlie Poole
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,
Post by Charlie Poole
along with a healthy diet, reduces your potential for chronic
lameness and boredom. Vote Now at
http://www.sourceforge.net/community/cca08
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
----------------------------------------------------------------------
Post by Charlie Poole
--- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open
source project,
Post by Charlie Poole
along with a healthy diet, reduces your potential for
chronic lameness
Post by Charlie Poole
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
--------------------------------------------------------------
-----------
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
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
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
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
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
Charlie Poole
2008-07-04 21:38:40 UTC
Permalink
It's not (entirely) automagical. If you don't specify
where the arguments are to be found, then they must be
provided by one or more members of the same class,
annotated with TestCaseFactoryAttribute( Type, Type... )
where the types match the required types of the method.

Whether this is a normal use case is probably a matter
of style. Some folks may want to specify all their
test case factories by name, others may want NUnit
to find them. Personally, I have only used this in
order to test it. :-)

FWIW, I should mention that this is an approach that is
familiar to mbUnit users, although the use of an array
of types to characterize a factory is new to NUnit.

Charlie
-----Original Message-----
Sent: Friday, July 04, 2008 2:05 PM
Cc: Charlie Poole
Subject: Re: [nunit-developer] Updates to NUnit 2.5
Is "Factory without arguments" a ubique use case or an
esoteric one? I for one would like to clearly state were my
Test Case data came from (the Source)
I always think twice before making things "automagical" ...
Sounds like a good possibility, although it seems to share with
"Factory" the deficiency of not making much sense when used without
arguments.
Maybe I should leave the attribute off in that case...
What if
[Test]
public void Method(int x, int y) { ... } automatically
searched for a
factory within the class?
Would that lead to confusion?
Charlie
-----Original Message-----
Behalf Of
Olof Bjarnason
Sent: Friday, July 04, 2008 1:27 PM
To: Charlie Poole
Subject: Re: [nunit-developer] Updates to NUnit 2.5
What about "Source"? Or maybe that's already taken?
Post by Charlie Poole
I just updated the online documentation to match what's in CVS.
http://nunit.org/?p=testCase&r=2.5
http://nunit.org/?p=factory&r=2.5
http://nunit.org/?p=testCaseFactory&r=2.5
I'm still looking for suggestions regarding renaming
FactoryAttribute.
Post by Charlie Poole
Charlie
-----Original Message-----
Behalf Of
Post by Charlie Poole
Charlie Poole
Sent: Thursday, July 03, 2008 7:27 PM
Subject: Re: [nunit-developer] Updates to NUnit 2.5
Hi All,
Latest checkin finishes work on TestCaseFactories, which
are methods,
Post by Charlie Poole
properties or fields that provide test cases to a
parameterized test.
Post by Charlie Poole
There's one outstanding question I could use some ideas on
- see the
Post by Charlie Poole
end of this note.
TestCaseFactoryAttribute is an optional attribute that can
be used to
Post by Charlie Poole
mark these factories. If used, it should specify the
types of the
Post by Charlie Poole
[TestCaseFactory(typeof(int), typeof(int), typeof(string))]
FactoryAttribute is used on the parameterized test itself
and has the
Post by Charlie Poole
[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
Post by Charlie Poole
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
Post by Charlie Poole
need to mark them with the TestCaseFactoryAttribute.
Compatible means that the types match the argumets of the
test method.
Post by Charlie Poole
Here's the question: I'm still not happy with "Factory" to
identify
Post by Charlie Poole
indicate that factories should be used, especially the
form without
Post by Charlie Poole
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,
Post by Charlie Poole
along with a healthy diet, reduces your potential for chronic
lameness and boredom. Vote Now at
http://www.sourceforge.net/community/cca08
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
---------------------------------------------------------------------
-
Post by Charlie Poole
--- Sponsored by: SourceForge.net Community Choice
Awards: VOTE NOW!
Post by Charlie Poole
Studies have shown that voting for your favorite open
source project,
Post by Charlie Poole
along with a healthy diet, reduces your potential for
chronic lameness
Post by Charlie Poole
and boredom. Vote Now at
http://www.sourceforge.net/community/cca08
Post by Charlie Poole
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
--------------------------------------------------------------
-----------
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
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
----------------------------------------------------------------------
--- 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
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
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
Olof Bjarnason
2008-07-04 21:56:24 UTC
Permalink
Post by Charlie Poole
It's not (entirely) automagical. If you don't specify
where the arguments are to be found, then they must be
provided by one or more members of the same class,
annotated with TestCaseFactoryAttribute( Type, Type... )
where the types match the required types of the method.
Whether this is a normal use case is probably a matter
of style. Some folks may want to specify all their
test case factories by name, others may want NUnit
to find them. Personally, I have only used this in
order to test it. :-)
Are these two methods of specifying "test case sets" equivalent?
Or is one of them more general than the other?
Post by Charlie Poole
FWIW, I should mention that this is an approach that is
familiar to mbUnit users, although the use of an array
of types to characterize a factory is new to NUnit.
Charlie
-----Original Message-----
Sent: Friday, July 04, 2008 2:05 PM
Cc: Charlie Poole
Subject: Re: [nunit-developer] Updates to NUnit 2.5
Is "Factory without arguments" a ubique use case or an
esoteric one? I for one would like to clearly state were my
Test Case data came from (the Source)
I always think twice before making things "automagical" ...
Sounds like a good possibility, although it seems to share with
"Factory" the deficiency of not making much sense when used without
arguments.
Maybe I should leave the attribute off in that case...
What if
[Test]
public void Method(int x, int y) { ... } automatically
searched for a
factory within the class?
Would that lead to confusion?
Charlie
-----Original Message-----
Behalf Of
Olof Bjarnason
Sent: Friday, July 04, 2008 1:27 PM
To: Charlie Poole
Subject: Re: [nunit-developer] Updates to NUnit 2.5
What about "Source"? Or maybe that's already taken?
Post by Charlie Poole
I just updated the online documentation to match what's in CVS.
http://nunit.org/?p=testCase&r=2.5
http://nunit.org/?p=factory&r=2.5
http://nunit.org/?p=testCaseFactory&r=2.5
I'm still looking for suggestions regarding renaming
FactoryAttribute.
Post by Charlie Poole
Charlie
-----Original Message-----
Behalf Of
Post by Charlie Poole
Charlie Poole
Sent: Thursday, July 03, 2008 7:27 PM
Subject: Re: [nunit-developer] Updates to NUnit 2.5
Hi All,
Latest checkin finishes work on TestCaseFactories, which
are methods,
Post by Charlie Poole
properties or fields that provide test cases to a
parameterized test.
Post by Charlie Poole
There's one outstanding question I could use some ideas on
- see the
Post by Charlie Poole
end of this note.
TestCaseFactoryAttribute is an optional attribute that can
be used to
Post by Charlie Poole
mark these factories. If used, it should specify the
types of the
Post by Charlie Poole
[TestCaseFactory(typeof(int), typeof(int), typeof(string))]
FactoryAttribute is used on the parameterized test itself
and has the
Post by Charlie Poole
[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
Post by Charlie Poole
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
Post by Charlie Poole
need to mark them with the TestCaseFactoryAttribute.
Compatible means that the types match the argumets of the
test method.
Post by Charlie Poole
Here's the question: I'm still not happy with "Factory" to
identify
Post by Charlie Poole
indicate that factories should be used, especially the
form without
Post by Charlie Poole
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,
Post by Charlie Poole
along with a healthy diet, reduces your potential for chronic
lameness and boredom. Vote Now at
http://www.sourceforge.net/community/cca08
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
---------------------------------------------------------------------
-
Post by Charlie Poole
--- Sponsored by: SourceForge.net Community Choice
Awards: VOTE NOW!
Post by Charlie Poole
Studies have shown that voting for your favorite open
source project,
Post by Charlie Poole
along with a healthy diet, reduces your potential for
chronic lameness
Post by Charlie Poole
and boredom. Vote Now at
http://www.sourceforge.net/community/cca08
Post by Charlie Poole
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
--------------------------------------------------------------
-----------
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
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
----------------------------------------------------------------------
--- 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
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
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
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
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
Charlie Poole
2008-07-05 04:47:35 UTC
Permalink
Hi Olof,
Post by Olof Bjarnason
Are these two methods of specifying "test case sets" equivalent?
Or is one of them more general than the other?
They are completely equivalent. If you specify all test case factories
by name, you never need to use the TestCaseFactory attribute. I provided
both approaches because other frameworks do so and some folks seem to
prefer one option, some the other.

I'll leave them both in for the alpha at any rate.

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
Charlie Poole
2008-06-25 01:35:07 UTC
Permalink
Hi Cliff,
Any reason the signature of the method could be changed.
Post by Charlie Poole
public interface ITestCaseProvider
{
bool Exists(MethodInfo method);
IEnumerable Get(MethodInfo method);
}
The same would be true for IParameterProvider also. IMO, it
seems redundant to include the type in the method name.
There's no type in the method name, but I see what you mean...
TestCase appears in the name of the interface and the name
of the each method. That's redundant in the declaration, although
not necessarily in using the interface.

When I write
provider.GetTestCasesFor(someMethod)
it makes sense to me. But
provider.Get(someMethod)
gives me pause - what am I getting.

In the end, this may just be a matter of style. I'm open to
more suggestions, but I think the verbs need objects to
make sense here.

There's no longer a IParameterProvider, ITestCaseProvider
replaces it.

Charlie
Thanks
cliff
-----Original Message-----
Charlie Poole
Sent: Tuesday, June 24, 2008 5:00 PM
Subject: Re: [nunit-developer] Updates to NUnit 2.5
More updates for those following CVS - note that the
attached emails
cover all the important changes since the Alpha 2 release,
and will be
reflected in the next Alpha in a few weeks.
There is a major change to the Test hierarchy: TestCase
doesn't exist
any longer. TestMethod inherits directly from Test now and
represents
a Test implemented by a method. There could be some further
changes in
this branch as well as for TestSuite, TestFixture, etc.
All this is part of the move to parameterized tests, which
blurs the
distinction between a suite and a case. I'm currently using "test
case" to refer to a single execution of a test with one set of
parameters, producing one result and the class names will begin to
reflect that.
NUnitTestCaseBuilder is now split in two, with the original builder
handling "regular" tests and ParameterizedTestCaseBuilder handling
parameterized tests. A new DynamicTestBuilder, which recognizes
DynamicTestAttribute and creates DynamicTests is
Charlie
Post by Charlie Poole
-----Original Message-----
Behalf Of
Post by Charlie Poole
Charlie Poole
Sent: Sunday, June 22, 2008 9:29 AM
Subject: Re: [nunit-developer] Updates to NUnit 2.5
More updates checked into CVS. All of this will be
documented for the
Post by Charlie Poole
release, but some of you may want an early heads-up,
especially if you
Post by Charlie Poole
are working on addins.
EXTENSIBILITY
The ParameterProviders extension point has been renamed to
TestCaseProviders. The interface that extensions must
implement is now
Post by Charlie Poole
public interface ITestCaseProvider
{
bool HasTestCasesFor(MethodInfo method);
IEnumerable GetTestCasesFor(MethodInfo method);
}
This is essentially the same as the IParameterProvider
interface in
Post by Charlie Poole
the first two alphas.
BUILT-IN PARAMETERIZED TESTS
TestCaseParameterProvider for TestCaseAttribute and
TestCaseFactoryProvider for FactoryAttribute.
TestCaseParameterProvider will perform a number of conversions in
order to make the provided argument compatible with method call.
TestCaseFactoryProvider can work with properties, methods
and fields
Post by Charlie Poole
that implement IEnumerable. For static cases, use of an
array is the
Post by Charlie Poole
simplest approach. Either static or instance members may be
used. For
Post by Charlie Poole
methods takin a single ValueType argument, the enumerator
may return
Post by Charlie Poole
the bare argument rather than an array with one member.
All of the above work at load time. For dynamic test cases,
provided
Post by Charlie Poole
at the instance of executin the test and possibly varying
from run to
Post by Charlie Poole
run, I plan to add DynamicTest and DynamicTestCaseProvider.
OTHER STUFF
The RequiredAddinAttribute may be placed on the assembly,
on a class
Post by Charlie Poole
or on a method. If the named addin is not loaded, the test
or suite is
Post by Charlie Poole
NotRunnable and shows up as red in the Gui.
Charlie
-----Original Message-----
Behalf Of
Post by Charlie Poole
Charlie Poole
Sent: Monday, June 16, 2008 12:14 PM
Subject: [nunit-developer] Updates to NUnit 2.5
Hi All,
Now that I'm back home, I can properly upload a number of
changes I
Post by Charlie Poole
made on my laptop while travelling.
1. The release is now 2.5 Alpha 3.
2. I have changed DataSourceAttribute to FactoryAttribute
and it may
now appear on a property, field or method. Any of these may
be either
static or instance members.
3. IParameterProvider.GetParametersFor(MethodInfo method)
now returns
IEnumerable rather than IList.
4. The Test abstract class now has default implementations
for several
properties that were previously abstract. One of the
Run() overloads has been removed.
I'll post further as more changes are made.
Charlie
--------------------------------------------------------------
-----------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just
about anything
Post by Charlie Poole
Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
--------------------------------------------------------------
-----------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just
about anything
Post by Charlie Poole
Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
--------------------------------------------------------------
-----------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just about anything
Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Charlie Poole
2008-06-25 16:00:17 UTC
Permalink
Bearing in mind that a class can implement all sorts of interfaces,
I'm hesitant to use short names as a matter of practice.

What do others think?

Charlie
-----Original Message-----
Sent: Wednesday, June 25, 2008 7:37 AM
Subject: RE: [nunit-developer] Updates to NUnit 2.5
Fair enough point and I considered that, but I think if you
testCases = provider.Get(someMethod);
then it would seem to provide the extra information you want.
A time when this would be a problem is when you have one
class implementing more than one interface with the simple
Get() signature, but that doesn't matter since you said
there's no IParameterProvider.
Thanks
cliff
-----Original Message-----
Sent: Tuesday, June 24, 2008 8:35 PM
Subject: RE: [nunit-developer] Updates to NUnit 2.5
Hi Cliff,
Any reason the signature of the method could be changed.
Post by Charlie Poole
public interface ITestCaseProvider
{
bool Exists(MethodInfo method);
IEnumerable Get(MethodInfo method);
}
The same would be true for IParameterProvider also. IMO,
it seems
redundant to include the type in the method name.
There's no type in the method name, but I see what you mean...
TestCase appears in the name of the interface and the name
of the each
method. That's redundant in the declaration, although not
necessarily
in using the interface.
When I write
provider.GetTestCasesFor(someMethod)
it makes sense to me. But
provider.Get(someMethod)
gives me pause - what am I getting.
In the end, this may just be a matter of style. I'm open to more
suggestions, but I think the verbs need objects to make sense here.
There's no longer a IParameterProvider, ITestCaseProvider
replaces it.
Charlie
Thanks
cliff
-----Original Message-----
Behalf Of
Charlie Poole
Sent: Tuesday, June 24, 2008 5:00 PM
Subject: Re: [nunit-developer] Updates to NUnit 2.5
More updates for those following CVS - note that the
attached emails
cover all the important changes since the Alpha 2 release,
and will be
reflected in the next Alpha in a few weeks.
There is a major change to the Test hierarchy: TestCase
doesn't exist
any longer. TestMethod inherits directly from Test now and
represents
a Test implemented by a method. There could be some further
changes in
this branch as well as for TestSuite, TestFixture, etc.
All this is part of the move to parameterized tests, which
blurs the
distinction between a suite and a case. I'm currently
using "test
case" to refer to a single execution of a test with one set of
parameters, producing one result and the class names will
begin to
reflect that.
NUnitTestCaseBuilder is now split in two, with the
original builder
handling "regular" tests and ParameterizedTestCaseBuilder
handling
parameterized tests. A new DynamicTestBuilder, which recognizes
DynamicTestAttribute and creates DynamicTests is
Charlie
Post by Charlie Poole
-----Original Message-----
Behalf Of
Post by Charlie Poole
Charlie Poole
Sent: Sunday, June 22, 2008 9:29 AM
Subject: Re: [nunit-developer] Updates to NUnit 2.5
More updates checked into CVS. All of this will be
documented for the
Post by Charlie Poole
release, but some of you may want an early heads-up,
especially if you
Post by Charlie Poole
are working on addins.
EXTENSIBILITY
The ParameterProviders extension point has been renamed to
TestCaseProviders. The interface that extensions must
implement is now
Post by Charlie Poole
public interface ITestCaseProvider
{
bool HasTestCasesFor(MethodInfo method);
IEnumerable GetTestCasesFor(MethodInfo method);
}
This is essentially the same as the IParameterProvider
interface in
Post by Charlie Poole
the first two alphas.
BUILT-IN PARAMETERIZED TESTS
TestCaseParameterProvider for TestCaseAttribute and
TestCaseFactoryProvider for FactoryAttribute.
TestCaseParameterProvider will perform a number of
conversions in
Post by Charlie Poole
order to make the provided argument compatible with
method call.
Post by Charlie Poole
TestCaseFactoryProvider can work with properties, methods
and fields
Post by Charlie Poole
that implement IEnumerable. For static cases, use of an
array is the
Post by Charlie Poole
simplest approach. Either static or instance members may be
used. For
Post by Charlie Poole
methods takin a single ValueType argument, the enumerator
may return
Post by Charlie Poole
the bare argument rather than an array with one member.
All of the above work at load time. For dynamic test cases,
provided
Post by Charlie Poole
at the instance of executin the test and possibly varying
from run to
Post by Charlie Poole
run, I plan to add DynamicTest and DynamicTestCaseProvider.
OTHER STUFF
The RequiredAddinAttribute may be placed on the assembly,
on a class
Post by Charlie Poole
or on a method. If the named addin is not loaded, the test
or suite is
Post by Charlie Poole
NotRunnable and shows up as red in the Gui.
Charlie
-----Original Message-----
Behalf Of
Post by Charlie Poole
Charlie Poole
Sent: Monday, June 16, 2008 12:14 PM
Subject: [nunit-developer] Updates to NUnit 2.5
Hi All,
Now that I'm back home, I can properly upload a number of
changes I
Post by Charlie Poole
made on my laptop while travelling.
1. The release is now 2.5 Alpha 3.
2. I have changed DataSourceAttribute to FactoryAttribute
and it may
now appear on a property, field or method. Any of these may
be either
static or instance members.
3. IParameterProvider.GetParametersFor(MethodInfo method)
now returns
IEnumerable rather than IList.
4. The Test abstract class now has default implementations
for several
properties that were previously abstract. One of the
Run() overloads has been removed.
I'll post further as more changes are made.
Charlie
--------------------------------------------------------------
Post by Charlie Poole
-----------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just
about anything
Post by Charlie Poole
Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
--------------------------------------------------------------
-----------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just
about anything
Post by Charlie Poole
Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
--------------------------------------------------------------
-----------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just
about anything
Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Charlie Poole
2008-06-25 16:24:40 UTC
Permalink
Hi Cliff,

Well, I never thought I'd agree that VB is elegant, but
I guess so. :-)

Essentially, VB let's you specify a different name for the
method. In C#, you do have a choice. You an implement the
interface explicitly, as in your example, or as a public
method. Only with the explicit interface do you have to
make a conversion to the interface type.

However, this is moot here, as you don't know the actual
type when you get the interface. In fact, the internal
NUnit implementation combines the IEnumerables from
multiple providers of different types.

Given the low-volume usage of this interface (implemented
by provider extensions, consumed by NUnit by builder extensions)
it probably doesn't matter a lot what we call it. Interfaces
like HandleException, which is implemented by user tests,
deserve more attention with regard to naming.

That said, it's still open for changing. Any other voices
on this?

Charlie
-----Original Message-----
Sent: Wednesday, June 25, 2008 9:09 AM
Subject: RE: [nunit-developer] Updates to NUnit 2.5
VB handles this issue a bit more elegantly than C#. In VB,
Public function GetTestCases() as Ienumerable Handles
ITestCaseProvider.Get()
End function
In C#, you have to explicitly use the interface and lose
Ienumerable ITestCaseProvider.Get()
{}
Now in order to use the C# version, you'd have to convert
your instance variable to ITestCaseProvider. A bit of
nuisance, but usable.
Thanks
cliff
-----Original Message-----
Sent: Wednesday, June 25, 2008 11:00 AM
Subject: RE: [nunit-developer] Updates to NUnit 2.5
Bearing in mind that a class can implement all sorts of interfaces,
I'm hesitant to use short names as a matter of practice.
What do others think?
Charlie
-----Original Message-----
Sent: Wednesday, June 25, 2008 7:37 AM
Subject: RE: [nunit-developer] Updates to NUnit 2.5
Fair enough point and I considered that, but I think if
you look at
testCases = provider.Get(someMethod);
then it would seem to provide the extra information you want.
A time when this would be a problem is when you have one class
implementing more than one interface with the simple
Get() signature, but that doesn't matter since you said
there's no
IParameterProvider.
Thanks
cliff
-----Original Message-----
Sent: Tuesday, June 24, 2008 8:35 PM
Subject: RE: [nunit-developer] Updates to NUnit 2.5
Hi Cliff,
Any reason the signature of the method could be changed.
Post by Charlie Poole
public interface ITestCaseProvider
{
bool Exists(MethodInfo method);
IEnumerable Get(MethodInfo method);
}
The same would be true for IParameterProvider also. IMO,
it seems
redundant to include the type in the method name.
There's no type in the method name, but I see what you mean...
TestCase appears in the name of the interface and the name
of the each
method. That's redundant in the declaration, although not
necessarily
in using the interface.
When I write
provider.GetTestCasesFor(someMethod)
it makes sense to me. But
provider.Get(someMethod)
gives me pause - what am I getting.
In the end, this may just be a matter of style. I'm
open to more
suggestions, but I think the verbs need objects to make
sense here.
There's no longer a IParameterProvider, ITestCaseProvider
replaces it.
Charlie
Thanks
cliff
-----Original Message-----
Behalf Of
Charlie Poole
Sent: Tuesday, June 24, 2008 5:00 PM
Subject: Re: [nunit-developer] Updates to NUnit 2.5
More updates for those following CVS - note that the
attached emails
cover all the important changes since the Alpha 2 release,
and will be
reflected in the next Alpha in a few weeks.
There is a major change to the Test hierarchy: TestCase
doesn't exist
any longer. TestMethod inherits directly from Test now and
represents
a Test implemented by a method. There could be some further
changes in
this branch as well as for TestSuite, TestFixture, etc.
All this is part of the move to parameterized tests, which
blurs the
distinction between a suite and a case. I'm currently
using "test
case" to refer to a single execution of a test with
one set of
parameters, producing one result and the class names will
begin to
reflect that.
NUnitTestCaseBuilder is now split in two, with the
original builder
handling "regular" tests and ParameterizedTestCaseBuilder
handling
parameterized tests. A new DynamicTestBuilder, which
recognizes
DynamicTestAttribute and creates DynamicTests is
Charlie
Post by Charlie Poole
-----Original Message-----
Behalf Of
Post by Charlie Poole
Charlie Poole
Sent: Sunday, June 22, 2008 9:29 AM
Subject: Re: [nunit-developer] Updates to NUnit 2.5
More updates checked into CVS. All of this will be
documented for the
Post by Charlie Poole
release, but some of you may want an early heads-up,
especially if you
Post by Charlie Poole
are working on addins.
EXTENSIBILITY
The ParameterProviders extension point has been
renamed to
Post by Charlie Poole
TestCaseProviders. The interface that extensions must
implement is now
Post by Charlie Poole
public interface ITestCaseProvider
{
bool HasTestCasesFor(MethodInfo method);
IEnumerable GetTestCasesFor(MethodInfo method);
}
This is essentially the same as the IParameterProvider
interface in
Post by Charlie Poole
the first two alphas.
BUILT-IN PARAMETERIZED TESTS
TestCaseParameterProvider for TestCaseAttribute and
TestCaseFactoryProvider for FactoryAttribute.
TestCaseParameterProvider will perform a number of
conversions in
Post by Charlie Poole
order to make the provided argument compatible with
method call.
Post by Charlie Poole
TestCaseFactoryProvider can work with properties, methods
and fields
Post by Charlie Poole
that implement IEnumerable. For static cases, use of an
array is the
Post by Charlie Poole
simplest approach. Either static or instance
members may be
used. For
Post by Charlie Poole
methods takin a single ValueType argument, the enumerator
may return
Post by Charlie Poole
the bare argument rather than an array with one member.
All of the above work at load time. For dynamic
test cases,
provided
Post by Charlie Poole
at the instance of executin the test and possibly varying
from run to
Post by Charlie Poole
run, I plan to add DynamicTest and
DynamicTestCaseProvider.
Post by Charlie Poole
OTHER STUFF
The RequiredAddinAttribute may be placed on the assembly,
on a class
Post by Charlie Poole
or on a method. If the named addin is not loaded, the test
or suite is
Post by Charlie Poole
NotRunnable and shows up as red in the Gui.
Charlie
-----Original Message-----
Behalf Of
Post by Charlie Poole
Charlie Poole
Sent: Monday, June 16, 2008 12:14 PM
Subject: [nunit-developer] Updates to NUnit 2.5
Hi All,
Now that I'm back home, I can properly upload a
number of
changes I
Post by Charlie Poole
made on my laptop while travelling.
1. The release is now 2.5 Alpha 3.
2. I have changed DataSourceAttribute to
FactoryAttribute
Post by Charlie Poole
and it may
now appear on a property, field or method. Any of
these may
Post by Charlie Poole
be either
static or instance members.
3.
IParameterProvider.GetParametersFor(MethodInfo method)
Post by Charlie Poole
now returns
IEnumerable rather than IList.
4. The Test abstract class now has default
implementations
Post by Charlie Poole
for several
properties that were previously abstract. One of the
Run() overloads has been removed.
I'll post further as more changes are made.
Charlie
--------------------------------------------------------------
Post by Charlie Poole
-----------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just
about anything
Post by Charlie Poole
Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
--------------------------------------------------------------
Post by Charlie Poole
-----------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just
about anything
Post by Charlie Poole
Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
--------------------------------------------------------------
-----------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just
about anything
Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Charlie Poole
2008-07-04 20:47:39 UTC
Permalink
I like that idea...
-----Original Message-----
Sent: Friday, July 04, 2008 1:42 PM
To: Olof Bjarnason; Charlie Poole
Subject: RE: [nunit-developer] Updates to NUnit 2.5
Charlie,
I don't have a suggestion for the name yet, other than
"TestFactory" or "TestDataFactory", but you could you change
the parameter from "string factoryNames" to "params string[]
factoryNames"? That way, the user doesn't have to worry
about a comma-separated list.
thanks
cliff
________________________________
of Olof Bjarnason
Sent: Fri 7/4/2008 3:26 PM
To: Charlie Poole
Subject: Re: [nunit-developer] Updates to NUnit 2.5
What about "Source"? Or maybe that's already taken?
Post by Charlie Poole
I just updated the online documentation to match what's in CVS.
http://nunit.org/?p=testCase&r=2.5
http://nunit.org/?p=factory&r=2.5
http://nunit.org/?p=testCaseFactory&r=2.5
I'm still looking for suggestions regarding renaming
FactoryAttribute.
Post by Charlie Poole
Charlie
-----Original Message-----
Behalf Of
Post by Charlie Poole
Charlie Poole
Sent: Thursday, July 03, 2008 7:27 PM
Subject: Re: [nunit-developer] Updates to NUnit 2.5
Hi All,
Latest checkin finishes work on TestCaseFactories, which
are methods,
Post by Charlie Poole
properties or fields that provide test cases to a
parameterized test.
Post by Charlie Poole
There's one outstanding question I could use some ideas on
- see the
Post by Charlie Poole
end of this note.
TestCaseFactoryAttribute is an optional attribute that can
be used to
Post by Charlie Poole
mark these factories. If used, it should specify the types of the
[TestCaseFactory(typeof(int), typeof(int), typeof(string))]
FactoryAttribute is used on the parameterized test itself
and has the
Post by Charlie Poole
[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
Post by Charlie Poole
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.
Post by Charlie Poole
Here's the question: I'm still not happy with "Factory" to
identify
Post by Charlie Poole
indicate that factories should be used, especially the
form without
Post by Charlie Poole
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,
Post by Charlie Poole
along with a healthy diet, reduces your potential for chronic
lameness and boredom. Vote Now at
http://www.sourceforge.net/community/cca08
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
----------------------------------------------------------------------
Post by Charlie Poole
--- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open
source project,
Post by Charlie Poole
along with a healthy diet, reduces your potential for
chronic lameness
Post by Charlie Poole
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
--------------------------------------------------------------
-----------
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
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
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
Loading...