No, there is no facility to pass information to the SetUp method indicating what
arguments will be used when the test method is called.
We could consider having parameters passed to the SetUp method itself or
allowing it to access the arguments to the Test method in a future release,
but we would need to have a strong use case for doing it.
Charlie
2011/2/24 Євген Чорнобривець <cherno...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
> To post to this group, send email to nunit-...@googlegroups.com.
> To unsubscribe from this group, send email to nunit-discus...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nunit-discuss?hl=en.
>
>
The original purpose of SetUp and TearDown was to create the common
state needed for all the tests in a class. This common state - generally
called a "fixture" - is the original of the terminology we use for a class
that contains tests: TestFixture.
Things have changed a bit since xUnit frameworks were first created
and other principles of organization have come forward. Nevertheless,
most people believe that a test class where many methods do not
make use of all the objects in the fixture should be split.
As an example, imagine I am testing the presenter class of an
MVP triad. In the SetUp, I will create a model object, a view
and the presenter itself. I will perform any common setup needed
for all the tests in this class. Then, in each test method, I will
perform any additional actions needed for that particular test.
Does that make the intention clearer?
Charlie
2011/2/25 Євген Чорнобривець <cherno...@gmail.com>: