Charlie Poole
2008-07-18 23:34:01 UTC
Hi All,
You'll recall we had a lot of discussion around this. Their were actually
several issues
1. Using just [Factory], the name didn't seem to make sense
2. It seemed dangerous that the same attribute used to point to a factory by
name was also used to tell NUnit to find a compatible factory as best it
could.
3. There was a request for the attribute to take an array of names rather
than a single string of comma-separated values.
I put out Alpha-3 without resolving these issues, but I just checked in a
fix that satisfies me.
1. The attribute that gives the factories to use is now called
FactoriesAttribute, rather than FactoryAttribute
2. FactoriesAttribute only has public constructors that specify the
factories by name.
3. The names are now in a params array, with overloads provided for those
working in languages that can't use such an array.
4. There is a new attribute, UseCompatibleFactoriesAttribute, that inherits
from FactoriesAttribute and has the public constructors I removed from
FactoriesAttribute.
So, per item 4, now you can write
[Test, UseCompatibleFactories]
to tell NUnit to use any factories it can find that match the types of the
parameterized method. This should reduce the risk of having data used for a
test unexpectedly.
You'll get this if you download the Head or in the next release.
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=/
You'll recall we had a lot of discussion around this. Their were actually
several issues
1. Using just [Factory], the name didn't seem to make sense
2. It seemed dangerous that the same attribute used to point to a factory by
name was also used to tell NUnit to find a compatible factory as best it
could.
3. There was a request for the attribute to take an array of names rather
than a single string of comma-separated values.
I put out Alpha-3 without resolving these issues, but I just checked in a
fix that satisfies me.
1. The attribute that gives the factories to use is now called
FactoriesAttribute, rather than FactoryAttribute
2. FactoriesAttribute only has public constructors that specify the
factories by name.
3. The names are now in a params array, with overloads provided for those
working in languages that can't use such an array.
4. There is a new attribute, UseCompatibleFactoriesAttribute, that inherits
from FactoriesAttribute and has the public constructors I removed from
FactoriesAttribute.
So, per item 4, now you can write
[Test, UseCompatibleFactories]
to tell NUnit to use any factories it can find that match the types of the
parameterized method. This should reduce the risk of having data used for a
test unexpectedly.
You'll get this if you download the Head or in the next release.
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=/