using NUnit.Framework;
using System;
namespace NUnitTest
{
[SetUpFixture]
public class GlobalSetup
{
static int test = 0;
[SetUp]
public void ImportConfigurationData ()
{
test++;
Console.WriteLine (test);
}
}
}
If I repeatedly run my tests along with this global setup function (using the standard NUnit GUI runner), the number that is printed increases by one each time. In other words, this function is run multiple times per test session.
Is there another way to really have a function run once per test session, or is this a bug in the runner?
This is a cheap workaround.