mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 16.7.1 to 16.8.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Commits](https://github.com/microsoft/vstest/compare/v16.7.1...v16.8.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
xUnit Tests
The folder contains xUnit tests for PowerShell Core project.
Running xUnit Tests
Go to the top level of the PowerShell repository and run full set of tests:
Start-PSxUnit inside a self-hosted copy of PowerShell.
Go to the test project folder and run dotnet test -c Release.
Use filter parameter to run only needed tests:
dotnet test -c Release --filter "FullyQualifiedName~UnitTest1 # Runs tests which have UnitTest1 in FullyQualifiedName
dotnet test --filter Name~TestMethod1 # Runs tests whose name contains TestMethod1
Creating xUnit Tests
Keep the folder structure that is for Pester ../../test/powershell and C# files ../../src.
Use namespace names started with PSTests.
namespace PSTests.YourNameSpace
{
}