28

In NUnit we use TestFixtureSetUp what is the equivalent test in MSTest?

Thanks

Richard Ev
  • 52,939
  • 59
  • 191
  • 278
kumar
  • 8,207
  • 20
  • 85
  • 176

2 Answers2

33

here you can find good table which shows NUnit and MSTest attributes side by side:

https://www.lambdatest.com/blog/nunit-vs-xunit-vs-mstest/

for your answer it's ClassInitialize attribute

Robert
  • 3,276
  • 1
  • 17
  • 26
20

You're looking for the [ClassInitialize] attribute:

[ClassInitialize]
public static void Initialize(TestContext testContext) { ... } 
SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964