1.0 KiB
1.0 KiB
title | description | author | ms.author | monikerRange | ms.date | ms.topic | ms.prod | uid |
---|---|---|---|---|---|---|---|---|
Unit Testing | Unit Testing | afshinm | amehrabani | >= aspnetcore-6.0 | 02/10/2023 | article | aspnet-core | 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 you 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.