← Back to team overview

nunit-core team mailing list archive

[Bug 1159688] Re: NUnit TestFixtureSetUp runs multiple times?

 

** Project changed: nunitv2 => nunit-3.0

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

Title:
  NUnit TestFixtureSetUp runs multiple times?

Status in NUnit Test Framework:
  New

Bug description:
  
  Hi, i meet this problem, too , but i can't research any solution..Please show me how to fix it or i must install new verion?...

  http://stackoverflow.com/questions/11316623/nunit-testfixturesetup-
  runs-multiple-times

  I have a basic Test setup using NUnit 2.6 and Visual NUnit in Visual
  Studio 2010. My problem is that when I'm running all tests it seems
  like the FixtureSetup method (which has the TestFixtureSetUpAttribute)
  is running one time for each of the tests.

  I've also tried to put the Init code to the constructor, but it gives
  the same results.

  The tests themselves reports their run time to runtime like 0.003 and
  0.032 and so on.

      [TestFixture]
      public class MODatabaseTests
      {
          [TestFixtureSetUp]
          public static void FixtureSetup()
          {
             // Perform heavy init (~1.5s)
          }

          [Test]
          public void TestA()
          {
              ...
          }

          [Test]
          public void TestB()
          {
              ...
          }

      }

To manage notifications about this bug go to:
https://bugs.launchpad.net/nunit-3.0/+bug/1159688/+subscriptions