One-time initialization for NUnit

The [SetUpFixture] attribute allows you to run setup and/or teardown code once for all tests under the same namespace.

Here is the documentation on SetUpFixture. According to the documentation:

A SetUpFixture outside of any namespace provides SetUp and TearDown for the entire assembly.

So if you need SetUp and TearDown for all tests, then just make sure the SetUpFixture class is not in a namespace.

Alternatively, you could always define a static class strictly for the purpose of defining “global” test variables.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)