SetUp and TearDown Changes

Registered by Charlie Poole

Existing attributes provide per-test setup and teardown at the fixture level and one-time setup and teardown at the fixture, namespace and assembly levels.

The current set of features is somewhat confusing:

  * SetUpFixture seems not very well understood by users in general.
  * TestFixtureSetUp and TestFixtureTearDown could do with better names.
  * SetUp and TearDown designate per-test setup/teardown within a test fixture, one-time setup/teardown within a setup fixture

For NUnit 3.0 we will standardize the use of attributes for setup and teardown and rename some of them to make their function clearer.

Blueprint information

Status:
Not started
Approver:
NUnit Developers
Priority:
Medium
Drafter:
Charlie Poole
Direction:
Needs approval
Assignee:
None
Definition:
Discussion
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

A few quick thoughts:
- Most/Many users don't know what a Fixture is - this happened when we stop requiring inheritance from a base class
- The existing naming convention is confusing for people coming the java world (Gerard and I - maybe the only two people in the world who switch back and forth).

We might want to consider adopting the JUnit 4.x style naming:

Before/After - for before and after each test
BeforeClass/AfterClass - for before and after each class
BeforeNamespace/AfterNamespace - .... - I don't know why you would want to do this
BeforeAssembly/AfterAssembly -

Now it might useful to have one more: BeforeEverything/AfterEverything - I might use this to load a large file into RAM that I want to persist across all tests, in all assemblies. Yes I know very UnitTest

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.