← Back to team overview

nunit-core team mailing list archive

[Bug 784539] [NEW] Online docs for attribute inheritance incorrect/misleading

 

Public bug reported:

Using NUnit 2.5.2 with Resharper as the runner.

The online docs for the
[SetUp]/[TestFixtureSetUp]/[TearDown]/[TestFixtureTearDown] attributes
are misleading/incomplete with regard to inheritance.

I'm sure I've seen some documentation somewhere which explicitly states
that inheritance is supported for methods decorated with these
attributes and that they will be called in the logical order but I can't
find it now.

The online documentation for these attributes either doesn't mention
inheritance at all or suggests that you need to manually call the base
class method manually.

I have just tested this (even with the same method names in the derived
class) and everything works logically without having to call base
methods:

base:[TestFixtureSetUp]
derived:[TestFixtureSetUp]

base:[SetUp]  ** This section repeated per test
derived:[SetUp]
derived:[TearDown]
base:[TearDown]

derived:[TestFixtureTearDown]
base:[TestFixtureTearDown]

Cheers
Simon

** Affects: nunitv2
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
https://bugs.launchpad.net/bugs/784539

Title:
  Online docs for attribute inheritance incorrect/misleading

Status in NUnit V2 Test Framework:
  New

Bug description:
  Using NUnit 2.5.2 with Resharper as the runner.

  The online docs for the
  [SetUp]/[TestFixtureSetUp]/[TearDown]/[TestFixtureTearDown] attributes
  are misleading/incomplete with regard to inheritance.

  I'm sure I've seen some documentation somewhere which explicitly
  states that inheritance is supported for methods decorated with these
  attributes and that they will be called in the logical order but I
  can't find it now.

  The online documentation for these attributes either doesn't mention
  inheritance at all or suggests that you need to manually call the base
  class method manually.

  I have just tested this (even with the same method names in the
  derived class) and everything works logically without having to call
  base methods:

  base:[TestFixtureSetUp]
  derived:[TestFixtureSetUp]

  base:[SetUp]  ** This section repeated per test
  derived:[SetUp]
  derived:[TearDown]
  base:[TearDown]

  derived:[TestFixtureTearDown]
  base:[TestFixtureTearDown]

  Cheers
  Simon


Follow ups

References