3

I have some experience in MS Test but new to NUnit.

  1. Whether NUnit [Setup] is corresponding to [ClassInitialize] or [TestInitialize] in MS Test?
  2. What is the NUnit attribute corresponding to [TestInitialize]?

REFERENCE:

  1. https://stackoverflow.com/questions/1873191/testinitialize-gets-fired-for-every-test-in-my-visual-studio-unit-tests

  2. https://stackoverflow.com/questions/4602288/nunit-testcontext-currentcontext-test-not-working

LCJ
  • 977
  • 2
  • 13
  • 23
  • Though the site is about XUnit, you can get some of the most used ones here: http://xunit.codeplex.com/wikipage?title=Comparisons – C. Sederqvist Nov 05 '12 at 15:00

2 Answers2

2

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)

Glorfindel
  • 3,137
  • 6
  • 25
  • 33
henginy
  • 639
  • 6
  • 12
0

NUnit parallel to [ClassInitialize] is [OneTimeSetup]

Parallel to [TestInitialize] is [Setup]

ShayD
  • 101
  • 1