Definitive Guide to Parallelization in C# [MsTest,NUnit,SpecFlow]

Nikolay Advolodkin
Geek Culture
Published in
6 min readMar 11, 2021

--

Parallelization is the procedure of running tests on different environments at the same time. It can be extremely helpful in terms of lowering the test execution time.

The three more popular test parallelization frameworks you can use are:

  1. SpecFlow;
  2. MSTest;
  3. NUnit.

Parallelization with NUnit

To begin with, we will look at NUnit, which is one of the most popular testing frameworks for the .NET languages. It boasts user-friendly characteristics, as well as being easy to understand and open source.

How to set up Parallelization with NUnit?

The first thing you must do is define the project’s parallel scope. After this, the level of parallelism, i.e. the number of tests you can run at the same time, must be identified in your AssemblyInfo.cs class.

You should then add the [TestFixture] attribute to the test class. Finally, the attribute [Parallelizable] should be used in the test fixture.

--

--

Nikolay Advolodkin
Geek Culture

Nikolay Advolodkin is a self-driven SDET on a lifelong mission to create profound change in the IT world and ultimately leave a legacy for his loved ones