Hi Chris,
You sound a bit confused. SetupFixture has its methods run once per overall run, but if you subclass it with test fixtures you'll experience an undocumented behavior.
Do not subclass it, you can rather expose static members from it which you could populate inside its setup methods. You will probably then realize that its static constructor will be just enough and you won't need a SetupFixture anymore. For sure you'll never need a HasRun property whatsoever. Just as well as you'll then realize that loading your settings in a normal TestFixtureSetup method 5 times per run won't affect the execution time to a great extent and will simplify your whole code.
Simone
--
You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nunit-discus...@googlegroups.com.
To post to this group, send email to nunit-...@googlegroups.com.
Visit this group at http://groups.google.com/group/nunit-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
Then using a SetupFixture is not what you want, just move the initialization code where you read the user-specific settings to a TestFixtureSetup in your fixtures or a base class, as long as the same user is used by all tests in that fixture.
Hi, the NullListener should indeed be replaced with your custom listener, I forgot to update my code accordingly.
The GetSettings method can be called any time as the configuration from which you read the session id is always available during the test run, but when to call it I believe depends mainly on the lifecycle of the data you store in the database. If it does not matter to you because the data does not change during the whole test run then I would say do it as rarely as possible, possibly once during the whole run, as you are reading it from the DB and I assume doing it multiple times would slow down your tests.
You'll have to figure out what the exception is, NUnit might require that some classes are serializable as tests will run in a different AppDomain. Not having your code at hand makes it difficult to tell exactly what is happening, but if after spending some time on it you cannot figure it out post here some more details and we can try to help you.
...
Hi Chris,
glad to help. That method just allows you to use the TestDomain runner, nothing more.
You should expect some performance overhead associated with running tests in different AppDomains, but not a much longer running time. I can't help you there, you'll have to debug your code to see where the slowness comes from.
Simone