kumar
kumar

Reputation: 9387

what is the equivalent test attribute for TestFixtureSetUp of Nunit in MSTest

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

Thanks

Upvotes: 29

Views: 13554

Answers (2)

Robert
Robert

Reputation: 3302

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

Upvotes: 32

SLaks
SLaks

Reputation: 887195

You're looking for the [ClassInitialize] attribute:

[ClassInitialize]
public static void Initialize(TestContext testContext) { ... } 

Upvotes: 21

Related Questions