I have some experience in MS Test but new to NUnit.
- Whether NUnit [Setup] is corresponding to [ClassInitialize] or [TestInitialize] in MS Test?
- What is the NUnit attribute corresponding to [TestInitialize]?
REFERENCE:
-
https://stackoverflow.com/questions/1873191/testinitialize-gets-fired-for-every-test-in-my-visual-studio-unit-tests
-
https://stackoverflow.com/questions/4602288/nunit-testcontext-currentcontext-test-not-working
1
NUnit [SetUp] corresponds to [TestInitialize].
For [ClassInitialize], use [TestFixtureSetUp] in NUnit.
The complete list can be found by a simple search. (a little old tho)
NUnit parallel to [ClassInitialize]
is [OneTimeSetup]
- see https://docs.nunit.org/articles/nunit/writing-tests/attributes/onetimesetup.html
Parallel to [TestInitialize]
is [Setup]
- see https://docs.nunit.org/articles/nunit/writing-tests/attributes/setup.html