Hi Dave, This has been the historical behavior of NUnit for a long time. SetUp and TearDown are considered an integral part of the test and we have generally felt that refactoring by moving some setup from SetUp to the test itself - or vice versa - should not change the time reported.
As Simone suggests, can you give us some example of why this presents a problem for you? Charlie On Fri, Oct 26, 2012 at 10:44 AM, Simone Busoli <1071...@bugs.launchpad.net> wrote: > Hi Dave, > > it would be useful to know the reasons why you think that this behavior > is misleading and problematic. > > -- > You received this bug notification because you are a member of NUnit > Developers, which is subscribed to NUnit V2. > https://bugs.launchpad.net/bugs/1071819 > > Title: > Test time includes execution time of Setup and Teardown methods > > Status in NUnit V2 Test Framework: > New > > Bug description: > The calculated time of a test includes its SetUp and TearDown methods. > > This includes: > > The "time" attribute in the "test-case" element in an XML report is > not limited to the execution time of the decorated test method. > > The "MaxTime" attribute fails on this same value (time of Setup + time > of teardown + time of test). This is first of all misleading, and > secondly problematic. > > A work around would appear to be to avoid Setup and Teardown methods > (as has been suggested for other reasons by some) and do > setup/teardown in the scope of the fixture or the test class > constructor/destructor. In many cases, inlining setup and teardown > within the test case itself is not a feasible workaround. > > To manage notifications about this bug go to: > https://bugs.launchpad.net/nunitv2/+bug/1071819/+subscriptions > > _______________________________________________ > Mailing list: https://launchpad.net/~nunit-core > Post to : nunit-core@lists.launchpad.net > Unsubscribe : https://launchpad.net/~nunit-core > More help : https://help.launchpad.net/ListHelp -- You received this bug notification because you are a member of NUnit Developers, which is subscribed to NUnit V2. https://bugs.launchpad.net/bugs/1071819 Title: Test time includes execution time of Setup and Teardown methods Status in NUnit V2 Test Framework: New Bug description: The calculated time of a test includes its SetUp and TearDown methods. This includes: The "time" attribute in the "test-case" element in an XML report is not limited to the execution time of the decorated test method. The "MaxTime" attribute fails on this same value (time of Setup + time of teardown + time of test). This is first of all misleading, and secondly problematic. A work around would appear to be to avoid Setup and Teardown methods (as has been suggested for other reasons by some) and do setup/teardown in the scope of the fixture or the test class constructor/destructor. In many cases, inlining setup and teardown within the test case itself is not a feasible workaround. To manage notifications about this bug go to: https://bugs.launchpad.net/nunitv2/+bug/1071819/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~nunit-core Post to : nunit-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~nunit-core More help : https://help.launchpad.net/ListHelp