1011 B
1011 B
title | description | author | ms.author | monikerRange | ms.date | ms.topic | uid |
---|---|---|---|---|---|---|---|
Unit Testing | Unit Testing | afshinm | amehrabani | >= aspnetcore-6.0 | 10/03/2023 | article | migration/inc/unit-testing |
Unit Testing
In most cases, there's no need to set up additional components for running tests. But if the component being tested uses xref:System.Web.HttpRuntime, it might be necessary to start up the SystemWebAdapters
service, as shown in the following example:
:::code language="csharp" source="~/migration/inc/samples/unit-testing/Program.cs" id="snippet_UnitTestingFixture" :::
The tests must be executed in sequence, not in parallel. The preceding example illustrates how to achieve this by setting XUnit's DisableParallelization
option to true
. This setting disables parallel execution for a specific test collection, ensuring that the tests within that collection run one after the other, without concurrency.