← Back to team overview

nunit-core team mailing list archive

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

 

I only wanted to be sure this is an NUnit problem. On SO, they are talking
about Visual NUnit, which has no connection to NUnit. Since you are using
NUnit, let's continue the discussion...

How do you know that the TestFixtureSetUp is running twice? Have you
stopped it in the debugger? You can either use the debugger or put a
console write statement into each test and in the setup.

Charlie


On Tue, Mar 26, 2013 at 1:24 AM, nuahatde <maily0321@xxxxxxxxx> wrote:

> I haven't tried to console runners yet. In my test, I use NUnit GUI. So,
> Are there any ways to resolve my problem? To make clear my problem...May
> i send you all my project..it's just a small example ....Can i get your
> email and send you .rar file? Or...you don't need because you understood
> me?
>
> Sincerely!
>
> --
> You received this bug notification because you are subscribed to NUnit
> Extended Testing Platform.
> https://bugs.launchpad.net/bugs/1159688
>
> Title:
>   NUnit TestFixtureSetUp runs multiple times?
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/nunitv2/+bug/1159688/+subscriptions
>

-- 
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 V2 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/nunitv2/+bug/1159688/+subscriptions


References