Discussion:
addin
Mustafa F
2008-08-11 22:20:19 UTC
Permalink
Hi,

i was writing an addin for NUnit. I came accross the named parameter
attribute in the documentation. I used Property("Default","Value") on the
test fixture. Anyone have an idea on how I can retrieve this value in the
test decorator? The idea is to have a common value for all the tests in the
test fixture.


Thanks,
Mustafa
Charlie Poole
2008-08-12 00:27:38 UTC
Permalink
It's in the Properties of the test...

test.Properties["Default"]

Charlie


_____

From: nunit-developer-***@lists.sourceforge.net
[mailto:nunit-developer-***@lists.sourceforge.net] On Behalf Of Mustafa
F
Sent: Monday, August 11, 2008 3:20 PM
To: nunit-***@lists.sourceforge.net
Subject: [nunit-developer] addin


Hi,

i was writing an addin for NUnit. I came accross the named parameter
attribute in the documentation. I used Property("Default","Value") on the
test fixture. Anyone have an idea on how I can retrieve this value in the
test decorator? The idea is to have a common value for all the tests in the
test fixture.


Thanks,
Mustafa
Mustafa F
2008-08-12 01:24:36 UTC
Permalink
That would give the properties of an individual test case. What if I want to
access the properties of the testSetup or the fixture.

On Mon, Aug 11, 2008 at 8:27 PM, Charlie Poole
Post by Charlie Poole
It's in the Properties of the test...
test.Properties["Default"]
Charlie
------------------------------
*Sent:* Monday, August 11, 2008 3:20 PM
*Subject:* [nunit-developer] addin
Hi,
i was writing an addin for NUnit. I came accross the named parameter
attribute in the documentation. I used Property("Default","Value") on the
test fixture. Anyone have an idea on how I can retrieve this value in the
test decorator? The idea is to have a common value for all the tests in the
test fixture.
Thanks,
Mustafa
-------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/nunit-developer
Charlie Poole
2008-08-12 01:40:23 UTC
Permalink
Ah! If you were doing a TestCaseBuilder, the suite to which the new test is
being added
would be passed to you and you could look at it's properties. Unfortunately,
that's not
so for a decorator.

You'll have to use the passed in MemberInfo and reflect on the type. Use
ReflectedType
to get the proper type in cases where the method is in a base class.

Charlike


_____

From: Mustafa F [mailto:***@gmail.com]
Sent: Monday, August 11, 2008 6:25 PM
To: Charlie Poole
Cc: nunit-***@lists.sourceforge.net
Subject: Re: [nunit-developer] addin


That would give the properties of an individual test case. What if I want to
access the properties of the testSetup or the fixture.


On Mon, Aug 11, 2008 at 8:27 PM, Charlie Poole <***@pooleconsulting.com>
wrote:


It's in the Properties of the test...

test.Properties["Default"]

Charlie


_____

From: nunit-developer-***@lists.sourceforge.net
[mailto:nunit-developer-***@lists.sourceforge.net] On Behalf Of Mustafa
F
Sent: Monday, August 11, 2008 3:20 PM

To: nunit-***@lists.sourceforge.net

Subject: [nunit-developer] addin


Hi,

i was writing an addin for NUnit. I came accross the named parameter
attribute in the documentation. I used Property("Default","Value") on the
test fixture. Anyone have an idea on how I can retrieve this value in the
test decorator? The idea is to have a common value for all the tests in the
test fixture.


Thanks,
Mustafa


-------------------------------------------------------------------------
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
<http://moblin-contest.org/redirect.php?banner_id=100&url=/> &url=/
Mustafa F
2008-08-12 01:50:20 UTC
Permalink
Oh ok. I though I would have to use the TestCaseBuilder. However, i was able
to get the property from the FixtureType.GetCustomProperties() function. Not
the most elegant piece of good, so I might just end up writing the
testcasebuilder.

Thanks,
Mustafa

On Mon, Aug 11, 2008 at 9:40 PM, Charlie Poole
Post by Charlie Poole
Ah! If you were doing a TestCaseBuilder, the suite to which the new test
is being added
would be passed to you and you could look at it's properties.
Unfortunately, that's not
so for a decorator.
You'll have to use the passed in MemberInfo and reflect on the type. Use
ReflectedType
to get the proper type in cases where the method is in a base class.
Charlike
------------------------------
*Sent:* Monday, August 11, 2008 6:25 PM
*To:* Charlie Poole
*Subject:* Re: [nunit-developer] addin
That would give the properties of an individual test case. What if I want
to access the properties of the testSetup or the fixture.
Post by Charlie Poole
It's in the Properties of the test...
test.Properties["Default"]
Charlie
------------------------------
*Sent:* Monday, August 11, 2008 3:20 PM
*Subject:* [nunit-developer] addin
Hi,
i was writing an addin for NUnit. I came accross the named parameter
attribute in the documentation. I used Property("Default","Value") on the
test fixture. Anyone have an idea on how I can retrieve this value in the
test decorator? The idea is to have a common value for all the tests in the
test fixture.
Thanks,
Mustafa
-------------------------------------------------------------------------
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
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=/
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
Loading...