I'm using NUnit for our unit tests, but I'd like to implement something that sounds similar to xUnit's ICollectionFixture feature.
Specifically I'm thinking this would be useful for database integration tests so I can create a new database, run all the tests against that database from multiple test classes, and the drop the database at the end of the test run.
I know I can do this per test class using the OneTimeSetUp/OneTimeTearDown attributes, but
in this case I'd like to just create the database once for a whole test run.
I could do it for all tests in a namespace using the SetUpFixture attribute, but I have test classes in this namespace that don't need a database, so it would be annoying to have to wait for a database to be created just to run a non-database test.
I'm wondering whether a mix of OnetimeSetUp/SetUpFixture and a singleton would work, or whether NUnit's custom attributes could help, or if there's another way to solve this?